Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 14464bd

Browse files
committed
Fix #466: Add support for targeting .NET 4.5.2
1 parent 3bbbf0b commit 14464bd

6 files changed

Lines changed: 16 additions & 161 deletions

File tree

doc/Dependencies.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<ul>
1212
<li>
13-
<a href="http://www.microsoft.com/en-us/download/details.aspx?id=40772">Microsoft .NET Framework 4.5.1 Developer Pack</a> for .NET 4.5 code completion documentation
13+
<a href="http://www.microsoft.com/en-us/download/details.aspx?id=42637">Microsoft .NET Framework 4.5.2 Developer Pack</a> for .NET 4.5 code completion documentation
1414
</li>
1515
<li>
1616
<a href="http://www.microsoft.com/downloads/details.aspx?familyid=6B6C21D2-2006-4AFA-9702-529FA782D63B&amp;displaylang=en">Microsoft Windows SDK for Windows 7 and .NET Framework 4</a> (strongly recommended!)
@@ -47,6 +47,10 @@
4747
<th>Target platform</th>
4848
<th>Reference Assemblies</th>
4949
<tr>
50+
<tr>
51+
<td>.NET Framework 4.5.2</td>
52+
<td><a href="http://www.microsoft.com/en-us/download/details.aspx?id=42637">Microsoft .NET Framework 4.5.2 Developer Pack</a></td>
53+
</tr>
5054
<tr>
5155
<td>.NET Framework 4.5.1</td>
5256
<td><a href="http://www.microsoft.com/en-us/download/details.aspx?id=40772">Microsoft .NET Framework 4.5.1 Developer Pack</a></td>

src/Main/Base/Project/ICSharpCode.SharpDevelop.addin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,5 +2451,6 @@
24512451
<Static class="ICSharpCode.SharpDevelop.Project.TargetFramework" member="Net40Client" />
24522452
<Static class="ICSharpCode.SharpDevelop.Project.TargetFramework" member="Net45" />
24532453
<Static class="ICSharpCode.SharpDevelop.Project.TargetFramework" member="Net451" />
2454+
<Static class="ICSharpCode.SharpDevelop.Project.TargetFramework" member="Net452" />
24542455
</Path>
24552456
</AddIn>

src/Main/Base/Project/Project/TargetFrameworks/TargetFramework.cs

Lines changed: 1 addition & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

src/Main/Base/Project/Util/DotnetDetection.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ public static bool IsDotnet451Installed()
6161
return GetDotnet4Release() >= 378675;
6262
}
6363

64+
public static bool IsDotnet452Installed()
65+
{
66+
// 379893 is .NET 4.5.2 on my Win7 machine
67+
return GetDotnet4Release() >= 379893;
68+
}
69+
6470
static int? GetDotnet4Release()
6571
{
6672
using (var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full")) {

src/Main/Base/Project/Util/Versions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ static class Versions
3131
public static readonly Version V4_0 = new Version(4, 0);
3232
public static readonly Version V4_5 = new Version(4, 5);
3333
public static readonly Version V4_5_1 = new Version(4, 5, 1);
34+
public static readonly Version V4_5_2 = new Version(4, 5, 2);
3435
}
3536
}

src/Main/SharpDevelop/Parser/AssemblyParserService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ static string FindXmlDocumentation(FileName assemblyFileName, TargetRuntime runt
235235
break;
236236
case TargetRuntime.Net_4_0:
237237
default:
238-
xmlFileName = LookupLocalizedXmlDoc(Path.Combine(referenceAssembliesPath, @".NETFramework\v4.5.1", name))
238+
xmlFileName = LookupLocalizedXmlDoc(Path.Combine(referenceAssembliesPath, @".NETFramework\v4.5.2", name))
239+
?? LookupLocalizedXmlDoc(Path.Combine(referenceAssembliesPath, @".NETFramework\v4.5.1", name))
239240
?? LookupLocalizedXmlDoc(Path.Combine(referenceAssembliesPath, @".NETFramework\v4.5", name))
240241
?? LookupLocalizedXmlDoc(Path.Combine(referenceAssembliesPath, @".NETFramework\v4.0", name))
241242
?? LookupLocalizedXmlDoc(Path.Combine(frameworkPath, "v4.0.30319", name));

0 commit comments

Comments
 (0)