Error MSB3086: Task could not find “LC.exe” using the SdkToolsPath “”

msbuild

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2428,5):
Error MSB3086: Task could not find "LC.exe" using the SdkToolsPath ""
or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86". 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"

I tried to install windows sdk v8.0A. but the installation process was rolling back. I m using os window 10

I am using VS 2017 framework version 4.7

Best Answer

Error MSB3086: Task could not find “LC.exe” using the SdkToolsPath “”

To resolve this issue, please try to following troubleshootings:

  • Using the MSBuild.exe from Visual Studio 2017 instead of .net framework. The location of MSBuild in Visual Studio 2017 should be:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
    
  • Specify the path to the SDK directly in the .csproj file:

    <PropertyGroup>
      <TargetFrameworkSDKToolsDirectory>C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools</TargetFrameworkSDKToolsDirectory> 
    </PropertyGroup>
    

    or pass TargetFrameworkSDKToolsDirectory as a parameter to avoid having to edit your .csproj files

    MSBuild.exe mysolution.sln /t:build /p:TargetFrameworkSDKToolsDirectory="C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools"
    
  • Set a flag to tell MSBuild to ignore it:

    /p:GenerateSerializationAssemblies=Off
    
  • Try to re-install the Visual Studio 2017.

Hope this helps.

Related Topic