Wednesday, December 2, 2015

Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"

Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"


The imported project "C:\Program Files *** MSBuild Microsoft VisualStudio *** WebApplicationsMicrosoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. 

Solution:

Switch:

<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />

to:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />



or change:

<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

to:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

If the issue persists then remove the following block from your csproj file:

  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup> 

No comments:

Post a Comment