【问题标题】:Where is TargetFrameworkSDKToolsDirectory defined in web.configweb.config 中定义的 TargetFrameworkSDKToolsDirectory 在哪里
【发布时间】:2017-03-01 12:45:11
【问题描述】:

我遇到了与others 相同的问题,但有一点不同:这是一个没有项目文件的 Web 项目。

因此,鉴于此错误消息:

C:\MySolution\My.Project.Web\licenses.licx:无法将许可证文件转换为二进制资源。无法加载文件或程序集 'file:///C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\lc.exe' 或其依赖项之一。系统找不到指定的文件。

(确实没有“file:///C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\lc.exe”,但是“bin”中有一个子目录叫“ NETFX 4.5.1 工具”,其中 lc.exe 所在的位置。将其内容移动到“bin”没有效果)

我可以在 web.config 中哪里定义 TargetFrameworkSDKToolsDirectory 以便将其指向正确的路径?

使用:Windows 10 64x,Visual Studio Community Edition 2015

【问题讨论】:

    标签: asp.net visual-studio web-config


    【解决方案1】:

    在 app.config 中,您可以在 TargetFrameworkVersion 旁边定义类似这样的内容(我的示例来自 .NET 4.6.2)

    <?xml version="1.0" encoding="utf-8"?>
    <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
        <PropertyGroup>
          <AssemblyName>xxx</AssemblyName>
          <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
          <TargetFrameworkSDKToolsDirectory>C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools</TargetFrameworkSDKToolsDirectory>
          ... etc ...
        </PropertyGroup>
    ... etc ...
    

    假设它对 .NET 4.5 和 web.config 的工作方式相同。

    另见Task could not find "LC.exe" using SdkToolsPath

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-09
      • 2015-04-05
      • 1970-01-01
      • 1970-01-01
      • 2016-03-22
      相关资源
      最近更新 更多