[英]SGEN doesn't work after upgrading from VS2012 to VS2013
When I compile my c# solution under VS2013 (Version 12.0.21005.1 REL) it cannot build part of projects with error message: 当我在VS2013(版本12.0.21005.1 REL)下编译我的c#解决方案时,它无法使用错误消息构建部分项目:
Error 32 The command "“C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1A\\Bin\\NETFX 4.0 Tools\\sgen.exe” /a:"Project.dll" /f /v" exited with code 3. Project 错误32命令““ C:\\ Program Files(x86)\\ Microsoft SDKs \\ Windows \\ v8.1A \\ Bin \\ NETFX 4.0 Tools \\ sgen.exe” /a:"Project.dll“ / f / v”退出,并带有代码3.项目
Post build event: “$(FrameworkSDKDir)\\Bin\\NETFX 4.0 Tools\\sgen.exe” /a:"$(TargetPath)" /f /v 发布后事件:“$(FrameworkSDKDir)\\ Bin \\ NETFX 4.0 Tools \\ sgen.exe”/ a:“$(TargetPath)”/ f / v
Indeed, folder "C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1A\\Bin\\NETFX 4.0 Tools" doesn't exists: "\\Bin" contains folder "NETFX 4.5.1 Tools" only. 确实,文件夹“ C:\\ Program Files(x86)\\ Microsoft SDKs \\ Windows \\ v8.1A \\ Bin \\ NETFX 4.0 Tools”不存在:“ \\ Bin”仅包含文件夹“ NETFX 4.5.1 Tools”。
Target framework of project: ".NET Framework 4". 项目目标框架:“。NET Framework 4”。
solution (by Microsoft): 解决方案(由Microsoft):
It is best practice to use the $(SDK40ToolsPath) property to get the .NET SDK binaries path rather than manually building the path with the $(FrameworkSDKDir) property. 最佳实践是使用$(SDK40ToolsPath)属性获取.NET SDK二进制文件路径,而不是使用$(FrameworkSDKDir)属性手动构建路径。 Using “$(SDK40ToolsPath)sgen.exe” should work in Visual Studio 2013 and earlier versions. 使用“ $(SDK40ToolsPath)sgen.exe”应在Visual Studio 2013及更早版本中有效。
$(FrameworkSDKDir) value in VS macros (post build event) references invalid path VS宏中的$(FrameworkSDKDir)值(生成后事件)引用无效路径
I experienced this error today. 我今天遇到了这个错误。 The project I am working on is currently being maintained in VS2012. 我正在处理的项目目前正在VS2012中维护。 On my new install, I have VS2013 (installed first) and VS2012. 在我的新安装中,我有VS2013(首先安装)和VS2012。 I got this error building in VS2013. 我在VS2013中构建了这个错误。
The problem was the folder where sgen.exe was being run from doesn't exist on my machine. 问题是在我的机器上不存在运行sgen.exe的文件夹。 On my machine, I have $(FrameworkSDKDir)\\Bin\\NETFX 4.5.1 Tools\\
but not $(FrameworkSDKDir)\\Bin\\NETFX 4.0 Tools\\
folder. 在我的机器上,我有$(FrameworkSDKDir)\\Bin\\NETFX 4.5.1 Tools\\
但不是$(FrameworkSDKDir)\\Bin\\NETFX 4.0 Tools\\
文件夹。
To resolve the issue, I created a NETFX 4.0 Tools\\ in the parent source control director and checked it in. This way, the reference is no longer dependant on each user's machine. 为解决此问题,我在父源控件控制器中创建了一个NETFX 4.0 Tools \\并将其签入。这样,引用不再依赖于每个用户的计算机。 My post build is now "$SolutionDir\\..\\..\\NETFX 4.0 Tools\\sgen.exe" /force "$(TargetPath)"
我的帖子版本现在是"$SolutionDir\\..\\..\\NETFX 4.0 Tools\\sgen.exe" /force "$(TargetPath)"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.