I have a question regarding the 2 CLR versions, i.e. version 2 and version 4 of the .NET framework, which use different GAC locations. I have a client application built which references an assembly “X” from the v2 GAC (C:\Windows\Assembly). I am now updating the assembly “X” to run on v4 of the .NET framework (C:\Windows\Microsoft.NET\assembly), however, I do not want to recompile the client application. Note, assembly "X" is removed from the v2 GAC before installing the to v4 GAC.
Is it possible to create a publisher policy file which redirects an assembly which used to reside in version 2 of the CLR to version 4 of the CLR? If so, how is this achieved?
I have searched the MSDN, and understand there is an appliesTo field on the assemblyBinding element where you can specify the version of the .NET framework, but this seems to encompass the whole bind.
What I would like is something like:
<bindingRedirect oldVersion="1.0.0.0" .Net 2 newVersion="2.0.0.0" .Net 4/>
I have read here http://msdn.microsoft.com/en-us/magazine/dd727509.aspx that CLR v2.0 applications now cannot see CLR v4.0 assemblies in the GAC. However, you can force an app to use the updated CLR using:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
So would a mixture of this plus the publisher policy suffice, or is there another way?