我有一台VM机器,我复制了SDK文件和路径,转到注册表并将密钥添加到注册表中,但我一直收到resgen.exe
无法找到的错误:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1835,9):
error MSB3091: Task failed because "resgen.exe" was not found, or the correct
Microsoft Windows SDK is not installed. The task is looking for "resgen.exe"
in the"bin" subdirectory beneath the location specified in the Installation Folder
value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\
Windows\v7.0A. You may be able to solve the problem by doing one of the following:
1) Install the Microsoft Windows SDK.
2) Install Visual Studio 2010.
3) Manually set the above registry key to the correct location.
4) Pass the correct location into the "ToolPath" parameter of the task.
我查看了Microsoft\Microsoft SDKs\Windows\v7.0A
文件夹,并在resgen.exe
几乎每个网络文件夹(包括垃圾箱)中复制了resgen.exe
,但它一直告诉我无法找到{{1}}。我不知道该怎么做。
答案 0 :(得分:1)
确保您的环境变量路径包含ResGen.exe所在的文件夹
答案 1 :(得分:1)
运行Regedit编辑注册表。查找密钥HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SDKs \ Windows。如果还没有名为" CurrentVersion"的设置,请创建一个新的注册表设置" CurrentVersion"类型REG_SZ。确保它与HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SDKs \ Windows \ v7.0A中的设置ProductionVersion具有相同的值。
确保您拥有HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SDKs \ Windows \ v7.0A \ WinSDK-NetFX40Tools,HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SDKs \ Windows \ v7.0A \ WinSDK-NetFX40Tools-x86和HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Microsoft SDKs \ Windows \ v7.0A \ WinSDK-NetFX40Tools-x64存在于您的注册表中,并在每个文件中设置值InstallationFolder。
答案 2 :(得分:1)
我在项目中添加了以下SdkToolPath参数,这有帮助。当然它不是一个完整的解决方案,因为它不能在buildserver上运行,但是现在它可以工作,我只是不从我的机器上检查它,这意味着我可以做我需要的东西:
<GenerateResource SdkToolsPath="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools" Sources="@(TextResource)" OutputResources="@(TextResource->'$(OutDir)CommandStrings.resources')" />