Added .NET 4.5 check and support, this changes nothing except that we know if 4.5 is installed... which might help with bug fixing.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2462 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2013-02-05 15:56:25 +00:00
commit 1b95405fa9
3 changed files with 12 additions and 3 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<startup useLegacyV2RuntimeActivationPolicy="true"> <startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku="client"/> <supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/> <supportedRuntime version="v2.0.50727"/>
</startup> </startup>
<runtime> <runtime>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<startup useLegacyV2RuntimeActivationPolicy="true"> <startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku="client"/> <supportedRuntime version="v4.0"/>
<supportedRuntime version="v2.0.50727"/> <supportedRuntime version="v2.0.50727"/>
</startup> </startup>
<runtime> <runtime>

View file

@ -48,6 +48,11 @@ namespace Greenshot.Helpers {
} }
} }
public static bool IsNet45OrNewer() {
// Class "ReflectionContext" exists from .NET 4.5 onwards.
return Type.GetType("System.Reflection.ReflectionContext", false) != null;
}
public static string EnvironmentToString(bool newline) { public static string EnvironmentToString(bool newline) {
StringBuilder environment = new StringBuilder(); StringBuilder environment = new StringBuilder();
environment.Append("Software version: " + Application.ProductVersion); environment.Append("Software version: " + Application.ProductVersion);
@ -62,6 +67,10 @@ namespace Greenshot.Helpers {
environment.Append(", "); environment.Append(", ");
} }
environment.Append(".NET runtime version: " + Environment.Version); environment.Append(".NET runtime version: " + Environment.Version);
if (IsNet45OrNewer()) {
environment.Append("+");
}
if (newline) { if (newline) {
environment.AppendLine(); environment.AppendLine();
} else { } else {