问题描述
尝试在 Visual Studio 2008 专业版中构建我的项目时出现以下错误:
I am getting the following error when attempting to build my project in Visual Studio 2008 Professional Edition:
任务失败,因为找不到sgen.exe",或者没有安装正确的 Microsoft Windows SDK.该任务正在注册表项 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A 的 InstallationFolder 值中指定的位置下的bin"子目录中查找sgen.exe".您可以通过执行以下操作之一来解决问题:
- 安装适用于 Windows Server 2008 和 .NET Framework 3.5 的 Microsoft Windows SDK.
- 安装 Visual Studio 2008.
- 手动将上述注册表项设置到正确的位置.
- 将正确的位置传递到任务的ToolPath"参数中.
我尝试下载适用于 Windows Server 2008 和 .NET Framework 3.5 的 Microsoft Windows SDK,但仍然出现错误.我也尝试下载 Windows 7 SDK 和 .NET Framework 3.5,结果还是一样.
I tried downloading Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5, and still get the error. I also tried downloading the Windows 7 SDK and .NET Framework 3.5 and still same result.
我还尝试手动编辑注册表以更改 InstallationFolder,并尝试修复 Visual Studio 安装.
I also tried to manually editing the registry to change the InstallationFolder and I tried repairing the Visual Studio install.
该项目最初是在 Windows XP 上创建的,我正在尝试在运行 Windows 7 Enterprise 的重新格式化的机器上进行编译.
The project was originally created on Windows XP and I am trying to compile on a reformatted machine running Windows 7 Enterprise.
推荐答案
该问题似乎是由 Visual Studio 2008 在使用 Web 引用时引起的.我最终删除了 Web 引用,只使用了服务引用.
The problem appears to be caused by Visual Studio 2008 when using Web References. I ended up deleting the Web References and just used Service References.
I found a blog post about this posted here and here.
这篇关于任务失败,因为“sgen.exe"没有找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!