web.config 中定义的 TargetFrameworkSDKToolsDirectory 在哪里

Where is TargetFrameworkSDKToolsDirectory defined in web.config

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

因此,鉴于此错误消息:

C:\MySolution\My.Project.Web\licenses.licx: Could not transform licenses file into a binary resource. Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\lc.exe' or one of its dependencies. The system cannot find the file specified.

(确实没有"file:///C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\lc.exe",但是在"bin"中有一个名为"NETFX 4.5.1 Tools"的子目录,其中lc.exe是。将其内容移动到"bin"没有效果)

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

使用:Windows10 64x,Visual Studio社区版 2015

在 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