加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 在构建.NET 4时找不到LC.exe文件

发布时间:2020-12-15 06:19:00 所属栏目:百科 来源:网络整理
导读:迁移到.net 4.0时出现问题,在尝试构建时发生以下错误. C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets(1917,9): error MSB3086: Task could not find "LC.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHIN
迁移到.net 4.0时出现问题,在尝试构建时发生以下错误.
C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Microsoft.Common.targets(1917,9): 
  error MSB3086: Task could not find "LC.exe" using the SdkToolsPath "" 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 

 External Program Failed: C:windowsmicrosoft.netframeworkv4.0.30319MSBuild.exe
 (return code was 1)

微软Windows sdk的最新版本安装在机器上,但版本为v7.1.要解决这个问题,我把注册表项放在以下位置

HKEY_LOCAL_MACHINESOFTWAREMicrosoftMicrosoft SDKsWindowsv7.0AInstallationFolder 
 to C:Program FilesMicrosoft SDKsWindowsv7.1.

不过,我觉得将7.0A注册表项指向7.1安装感到有点脏.有没有人有更好的解决这个问题?

解决方法

看看: Running MSBuild fails to read SDKToolsPath

在其中一个答案Simmo建议将默认版本的SDK设置为7.1. Windows SDK的7.1版本比Visual Studio 2010附带的版本(即7.0a)更新. LC.exe包含在7.1中,一旦您使用WindowsSdkVer.exe将7.1设置为默认版本,一切正常.

然而,两个小怪物:
1)WindowsSdkVer.exe允许您从VS 2005和VS 2008中进行选择,但不列出VS 2010.只需设置VS 2008的默认版本,并在2010年生效.

2)WindowsSdkVer.exe -version:v7.1没有为我工作,但WindowsSdkVer.exe没有任何参数,它提出了一个Windows界面.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读