开发者

Build Errors When Migrating to VS 2010 and .NET4.0 from VS 2008 and .NET3.5

开发者 https://www.devze.com 2023-01-06 09:00 出处:网络
I have a VS 2008 project. This project\'s target framework 3.5. Everything is Ok开发者_运维技巧 in this situation.

I have a VS 2008 project. This project's target framework 3.5. Everything is Ok开发者_运维技巧 in this situation.

I migrated this project to VS 2010 and I also changed target framework to .Net 4.0. Then I tried to build the project. But I got an error which says me to about to use "NetFx40_LegacySecurityPolicy" switch. So I used that switch and errors related to this switch got away. But this time I encountered a different error which says "The "GenerateResource" task failed unexpectedly. System.InvalidOperationException: The security state of an AppDomain was modified by an AppDomainManager configured with the NoSecurityChanges flag.....". I searched this on web but I could not find a solution. Does anybody experiences this problem. Thanks for your help?


On your build server locate msbuild.exe.config in C:\Windows\Microsoft.NET\Framework\v4.0.30319 (you'll also have to change the x64 version if you're on a 64-bit box).

Add the following to the bottom of the config (in the section)

<NetFx40_LegacySecurityPolicy enabled="true"/>

In other words the end of your config should look like:

        </assemblyBinding>
    <NetFx40_LegacySecurityPolicy enabled="true"/>
    </runtime>
    <!-- To define one or more new toolsets, add an 'msbuildToolsets' element in this file. -->
</configuration>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号