0
votes

I have an old legacy application that was built in .Net fw. 3.5. However i managed to get it upgraded till .Net fw. 4.0 and cannot further migrate it to higher version as there are old components and third party dlls.

Now for a new integration work i am using a dll that is built in .Net fw 4.5 and its a very small dll which just makes some internal call i believe.

When i compile in VS 2010 specifing tools version as 4.0 and target framework as 4.0 it still gives me error saying assembly reference missing? and also gives details that the dll is of .Net fw 4.5 and the project is targeted to 4.0.

However when i uninstalled .Net fw 4.5 and vs 2015, 2013 and re installed 2010 and compiled it worked. and checked by deploying also.

Now since my build server has .Net 4.5.2 installed, i do not want to do all these uninstallation job.

Is there any way / workaround for making the project build in msbuild 4.0 and compile only by .Net fw 4.0 even when .Net 4.5 is installed in the machine?

Thanks a lot for the suggestions and helping me out

1
Project --> Properties --> Application --> Target Framework?HimBromBeere
Thats already set. It doesn't help.vidz

1 Answers

0
votes

Unfortunately the answer is No.

Dot Net 4.5 was an in place upgrade to Dot Net 4.0.

See this Scott Hanselman Blog Post

You could try using MSBuild from the command line. Sometimes Visual Studio is overly aggressive in how 'helpful' it is with resolving assembly reference.

The version of MSBuild that shipped with Dot Net 4.0 is at this path:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

That .Exe file is not the same after the 4.5 upgrade, but it is worth a try.