問題描述
您好,在使用 VS2008 及其相關工具進行編譯時,我在運行用于正確構建基于 .Net 2.0 的網站的 NAnt 腳本時遇到了一些問題.我最近將所有項目/解決方案文件升級到 VS2010,現在我的構建失敗并出現以下錯誤:
Howdy, I'm having a bit of an issue runnning a NAnt script that used to properly build my .Net 2.0 based website, when compiling with VS2008 and it's associated tools. I've recently upgraded all the project/solution files to VS2010, and now my build fails with the following error:
[執行]C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets(2249,9):錯誤 MSB3086:找不到任務"sgen.exe" 使用 S dkToolsPath ""或注冊表項"HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoftSDKsWindowsv7.0A".確保SdkToolsPath 設置和工具存在于正確的處理器中下的具體位置SdkToolsPath 和 Microsoft已安裝 Windows SDK
[exec] C:WindowsMicrosoft.NETFramework64v4.0.30319Microsoft.Common.targets(2249,9): error MSB3086: Task could not find "sgen.exe" using the S dkToolsPath "" or the registry key "HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SDKsWindowsv7.0A". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed
現在,我確實在構建服務器上安裝了 Windows SDK 的早期版本 (.Net 3.5),并且安裝了完整的 .Net 4.0 框架,但我沒有運行過特定于 .Net 4.0 版本的Windows SDK.
Now, I DO have prior versions (.Net 3.5) of the Windows SDK installed on the build server, and the full .Net 4.0 framework is installed, but I've not run across a .Net 4.0 specific version of the Windows SDK.
經過一番實驗和研究,我終于設置了一個新的環境變量SDKToolsPath",并將其指向我的 windows 6.0 sdk 文件夾中的 sgen.exe 副本.這產生了相同的錯誤,但它讓我注意到即使設置了 SDKToolsPath 環境變量(確認我可以在命令行回顯"它并且它具有預期值),錯誤消息似乎表明它是沒有被閱讀(注意空引號).
After a bit of experimentation and research, I finally just setup a new environmental variable "SDKToolsPath" and pointed it to the copy of sgen.exe in my windows 6.0 sdk folder. This generated the same error, but it got me to notice that even though the SDKToolsPath environmental variable IS set (confirmed that I can "echo" it at the command line and it has the expected value), the error message seems to indicated that it's not being read (note the empty quotes).
我發現的大部分信息都是特定于 .Net 3.5(或更早版本)的.目前還沒有多少與 4.0 相關的內容.搜索錯誤代碼 MSB3086 也沒有任何用處.知道這可能是什么嗎?
Most of the information I've found is .Net 3.5 (or earlier) specific. Not much 4.0 related out there yet. Searching for error code MSB3086 generated nothing useful either. Any idea what this might be?
斯科特
推薦答案
我不得不硬著頭皮在我們的構建服務器上安裝 VS 2010 來解決這個問題.據我所知,MSDN 上的任何地方都沒有 7.0A 版本的 Windows SDK.但是,安裝 VS 2010 似乎會安裝它,在 Program FilesMicrosoft SDKsWindows 中創建一個 7.0A regkey 和一個 7.0A 文件夾.
I had to bite the bullet and install VS 2010 on our build server to fix this issue. As far as I can see, there's no 7.0A version of the Windows SDK available anywhere on MSDN. However, installing VS 2010 appears to install it, creating a 7.0A regkey and a 7.0A folder in Program FilesMicrosoft SDKsWindows.
這篇關于運行 MSBuild 無法讀取 SDKToolsPath的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!