@@ -37,6 +37,7 @@ public abstract class TargetFramework
3737 public static readonly TargetFramework Net40Client = new DotNet4xClient ( Versions . V4_0 , RedistLists . Net40Client , DotnetDetection . IsDotnet40Installed ) ;
3838 public static readonly TargetFramework Net45 = new DotNet4x ( Versions . V4_5 , RedistLists . Net45 , DotnetDetection . IsDotnet45Installed ) ;
3939 public static readonly TargetFramework Net451 = new DotNet4x ( Versions . V4_5_1 , RedistLists . Net45 , DotnetDetection . IsDotnet451Installed ) ;
40+ public static readonly TargetFramework Net452 = new DotNet4x ( Versions . V4_5_2 , RedistLists . Net45 , DotnetDetection . IsDotnet452Installed ) ;
4041
4142 /// <summary>
4243 /// Retrieves a target framework by a 'name'.
@@ -230,163 +231,4 @@ public override string ToString()
230231 return DisplayName ;
231232 }
232233 }
233-
234- /*
235- public class TargetFramework
236- {
237- public readonly static TargetFramework Net20 = new TargetFramework("v2.0", ".NET Framework 2.0") {
238- SupportedRuntimeVersion = "v2.0.50727",
239- MinimumMSBuildVersion = new Version(2, 0),
240- // .NET 2.0/3.0/3.5 can only be used if .NET 3.5 SP1 is installed
241- IsAvailable = DotnetDetection.IsDotnet35SP1Installed
242- };
243- public readonly static TargetFramework Net30 = new TargetFramework("v3.0", ".NET Framework 3.0") {
244- SupportedRuntimeVersion = "v2.0.50727",
245- BasedOn = Net20,
246- MinimumMSBuildVersion = new Version(3, 5)
247- };
248- public readonly static TargetFramework Net35 = new TargetFramework("v3.5", ".NET Framework 3.5") {
249- SupportedRuntimeVersion = "v2.0.50727",
250- BasedOn = Net30,
251- MinimumMSBuildVersion = new Version(3, 5)
252- };
253- public readonly static TargetFramework Net35Client = new ClientProfileTargetFramework(Net35) {
254- RequiresAppConfigEntry = true
255- };
256- public readonly static TargetFramework Net40 = new TargetFramework("v4.0", ".NET Framework 4.0") {
257- BasedOn = Net35,
258- MinimumMSBuildVersion = new Version(4, 0),
259- SupportedSku = ".NETFramework,Version=v4.0",
260- RequiresAppConfigEntry = true,
261- IsAvailable = DotnetDetection.IsDotnet40Installed
262- };
263- public readonly static TargetFramework Net40Client = new ClientProfileTargetFramework(Net40) {
264- BasedOn = Net35Client
265- };
266- public readonly static TargetFramework Net45 = new TargetFramework("v4.5", ".NET Framework 4.5") {
267- BasedOn = Net40,
268- MinimumMSBuildVersion = new Version(4, 0),
269- SupportedRuntimeVersion = "v4.0",
270- SupportedSku = ".NETFramework,Version=v4.5",
271- RequiresAppConfigEntry = true,
272- IsAvailable = DotnetDetection.IsDotnet45Installed
273- };
274- public readonly static TargetFramework Net451 = new TargetFramework("v4.5.1", ".NET Framework 4.5.1") {
275- BasedOn = Net45,
276- MinimumMSBuildVersion = new Version(4, 0),
277- SupportedRuntimeVersion = "v4.0",
278- SupportedSku = ".NETFramework,Version=v4.5.1",
279- RequiresAppConfigEntry = true,
280- IsAvailable = DotnetDetection.IsDotnet451Installed
281- };
282-
283- public readonly static TargetFramework[] TargetFrameworks = {
284- Net451, Net45, Net40, Net40Client, Net35, Net35Client, Net30, Net20
285- };
286-
287- public readonly static TargetFramework DefaultTargetFramework = Net40Client;
288-
289- public static TargetFramework GetByName(string name)
290- {
291- foreach (TargetFramework tf in TargetFrameworks) {
292- if (tf.Name == name)
293- return tf;
294- }
295- throw new ArgumentException("No target framework '" + name + "' exists");
296- }
297-
298- string name, displayName;
299-
300- public TargetFramework(string name, string displayName)
301- {
302- this.name = name;
303- this.displayName = displayName;
304- this.SupportedRuntimeVersion = name;
305- this.IsAvailable = delegate {
306- if (this.BasedOn != null)
307- return this.BasedOn.IsAvailable();
308- else
309- return true;
310- };
311- }
312-
313- public string Name {
314- get { return name; }
315- }
316-
317- public string DisplayName {
318- get { return displayName; }
319- }
320-
321- /// <summary>
322- /// Function that determines if this target framework is available.
323- /// </summary>
324- public Func<bool> IsAvailable { get; set; }
325-
326- /// <summary>
327- /// Supported runtime version string for app.config
328- /// </summary>
329- public string SupportedRuntimeVersion { get; set; }
330-
331- /// <summary>
332- /// Supported SKU string for app.config.
333- /// </summary>
334- public string SupportedSku { get; set; }
335-
336- /// <summary>
337- /// Specifies whether this target framework requires an explicit app.config entry.
338- /// </summary>
339- public bool RequiresAppConfigEntry { get; set; }
340-
341- /// <summary>
342- /// Gets the minimum MSBuild version required to build projects with this target framework.
343- /// </summary>
344- public Version MinimumMSBuildVersion { get; set; }
345-
346- /// <summary>
347- /// Gets the previous release of this target framework.
348- /// </summary>
349- public TargetFramework BasedOn { get; set; }
350-
351- public virtual bool IsCompatibleWith(CompilerVersion compilerVersion)
352- {
353- return MinimumMSBuildVersion <= compilerVersion.MSBuildVersion;
354- }
355-
356- public bool IsBasedOn(TargetFramework potentialBase)
357- {
358- TargetFramework tmp = this;
359- while (tmp != null) {
360- if (tmp == potentialBase)
361- return true;
362- tmp = tmp.BasedOn;
363- }
364- return false;
365- }
366-
367- public override string ToString()
368- {
369- return DisplayName;
370- }
371-
372-
373- }
374-
375- public class ClientProfileTargetFramework : TargetFramework
376- {
377- public TargetFramework FullFramework { get; private set; }
378-
379- public ClientProfileTargetFramework(TargetFramework fullFramework)
380- : base(fullFramework.Name + "Client", fullFramework.DisplayName + " Client Profile")
381- {
382- this.FullFramework = fullFramework;
383- this.SupportedRuntimeVersion = fullFramework.SupportedRuntimeVersion;
384- this.MinimumMSBuildVersion = fullFramework.MinimumMSBuildVersion;
385- this.IsAvailable = fullFramework.IsAvailable;
386- if (fullFramework.SupportedSku != null)
387- this.SupportedSku = fullFramework.SupportedSku + ",Profile=Client";
388- else
389- this.SupportedSku = "Client";
390- }
391- }*/
392234}
0 commit comments