MSBuild cannot find SGen when compiling a solution

可紊 提交于 2019-12-05 04:53:35

This seems to be a common issue I just ran into these days myself.

In your project properties on the "Build" tab set the option "Generate serialization assembly" from "Auto" to "Off".


update

If you not already tried, make sure that <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> is set for Release AND Debug configuration.

I think there is a solution without the pain of installing old versions of VS

Please try the following:

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\v2.0\

String Value: Name: InstallationFolder Value(default): C:\Program Files (x86)\Microsoft.NET\SDK\v2.0\

or save this code as .reg file and execute:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v2.0]
"InstallationFolder"="C:\\Program Files (x86)\\Microsoft.NET\\SDK\\v2.0

In your project properties on the "Build" tab set the option "Generate serialization assembly" from "Auto" to "Off".

Its resolved my issue.

I'm not sure what or why this was happening but what I did to get around this was to install Visual Studio 2005. I had already installed the .NET 2.0 SDK as well as the .NET 3.5 SDK with no luck but something with the Visual Studio 2005 installer resolved this issue for me. This is a HORRIBLE solution, but it was, nonetheless, a solution.

Hopefully we can migrate to .NET 4.0 soon and be completed rid of .NET 2.0 and its issues.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!