tags:

views:

24

answers:

1

I have .net 2.0 application (third party) is window's application(DLL's) -> future plans to move to .net 4.0

.net 2.0 my application(web service /asmx) interacts with above windows application (DLL) . these DLL's are updated frequently every 2 months, so direct reference will not work hence my web service has bindings set in web config file, here is the example below

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="ABCProcesses" publicKeyToken="21f532fe36bf9cd6" culture="neutral" />
        <bindingRedirect oldVersion="1.0.0.0-65535.65535.65535.65535 " newVersion="3.128.20.0" />
        <codeBase version="3.128.20.0" href="file:///C:\Program Files\APPS\DLL\ABCProcesses.dll" />
      </dependentAssembly></runtime>

Every time the DLL versions are changed i have to update my config file with new version number.

Now my question is

if the above .net 2.0 windows application(third party DLL) is moved to .net 4.0 windows application(DLL), will this effect my net2.0 web service accessing the DLL's or will i be forced to move to .net 4.0 WCF ?

A: 

You can't reference a .NET 4.0 assembly from 2.0, you would need to upgrade as well or hope that the vendor continues to maintain the 2.0 version as well.

Paolo
Thanks Paolo for a straight forward answer ufortunately according to this link http://social.msdn.microsoft.com/Forums/en-US/netfxgeneralprerelease/thread/bef443cc-5413-4322-8d9a-117abd2386d3 .net2.0 assemblies can access .net4.0 if they run under same .net4.0 clr. Does that mean all i have to do is uninstall VS2005 and install VS2010 and run my app as it is?
Gauls
Yes if your assemblies are running under 4.0 this will work. However you can't just install VS2010. Without recompiling, your exe/dll will still kick off in .Net 2.0 if it's the entry point - you'll need to add a supportedRuntime option to the .exe.config file or recompile under 4.0.
Paolo
Only option will be to recomplie and run under 4.0 but as 4.0 is backward compatible will that still support webservice and wcf both? does recompiling wud mean move from webservice to WCF?
Gauls
You can recompile (and yes its backwards compatible so shouldn't be an issue). Alternatively you can set a config option to tell .NET to run under a specific version (see http://msdn.microsoft.com/en-us/library/w4atty68.aspx), not 100% sure this 2nd method will work, but should do in theory.
Paolo