We have an application that supports both .NET 2.0 and .NET 4.0 and we switch the few framework dependent assemblies with <bindingRedirect />
. We've used the <supportedRuntime />
element to allow the application to run using the latest framework if available. However, we do still require the full profile, not just the client profile.
The documentation for .NET 3.5 indicates that you must explicitly opt-in to client only support by adding a sku="client"
attribute to the <supportedRuntime />
element.
The sku attribute name is case-sensitive. If the sku attribute is missing, or if its value is set to anything other than "client", the runtime assumes the application is not a .NET Framework Client Profile application.
However, with .NET 4.0 detailed documentation on the sku attribute is missing. In our tests the .NET runtime will use the .NET 4.0 client profile even if the sku attribute is missing. This is a problem since it doesn't allow dynamic redirection with the .config file. I've tried to use sku="full"
to try and force it to only use the full profile but that just results in no .NET 4.0 runtime being supported.
Does anyone know of a way to force the use of the full .NET profile when using <supportedRuntime />
(or other comparable solution) to support multiple .NET framework versions?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0.30319" />
<supportedRuntime version="v2.0.50727" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
appliesTo="v4.0.30319">
<dependentAssembly>
<assemblyIdentity name="Application"
publicKeyToken="798276055709c98a"
/>
<bindingRedirect oldVersion="4.1.2000.0"
newVersion="4.1.4000.0" />
<codeBase version="4.1.4000.0"
href="Redistributable\.NET 4.0\Application.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
My understanding is this would work:
<supportedRuntime version="v4.0.30319" sku=".NETFramework,Version=v4.0.1" />
<supportedRuntime version="v4.0.30319" sku=".NETFramework,Version=v4.0" />
There is no Profile=Full, but the Profile is meant to restrict to a smaller SKU per my understanding.
The list of installed SKUs can be found at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With