Where to put 'useLegacyV2RuntimeActivationPolicy' for assembly in TFS2012

While I am locally getting an error in unit test:

Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information 

And the solution is to add

 <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0"/> </startup> </configuration> 

to the configuration file located in

 c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE \CommonExtensions\Microsoft\TestWindow\vstest.executionengine.x86.exe.config 

This is still happening incorrectly on our TFS2012 build server. I also added startup tags to the file on TFS2012, but the build server reports an error.

How do I get this to work in the unit test project (using the new unit test structure VS2012 and TFS2012) in the assembly definition?

+4
source share
1 answer

You have problems running on TFS, you can try installing it programmatically (for example, using this approach ). Although I would not recommend using this in productive code, this should be quite sufficient when it comes to UnitTests.

+1
source

Source: https://habr.com/ru/post/1441846/


All Articles