The imported project Microsoft.WebApplications.targets was not found

后端 未结 10 1060
野的像风
野的像风 2021-01-07 18:15

I have this error when configuring continuous integration in TFS server, but found the answer already. Maybe this will help others:

The imported project \"C:         


        
相关标签:
10条回答
  • 2021-01-07 18:27
    <!--<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />-->
    

    Comment above line in .CSproj. Seems like bug with Microsoft which do not remove or comment while updating project from visual studio 2008 to 2010.

    0 讨论(0)
  • 2021-01-07 18:30

    Download & install Microsoft Visual Studio 2013 Shell (Isolated) Redistributable Package. Or use the direct link to vs_isoshell.exe. I intend to make an NuGet package for this at a later date.

    The advantage I see to this approach is it removes any doubt on copyright issues.

    0 讨论(0)
  • 2021-01-07 18:32

    I also met this error on VS2017; then i comment out below two items:

    <!--<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /><Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />-->
    

    reopen the solution , the project can be load successfully again. (i don't know how this happen, because this project can be load normally before, maybe i had added some new feature through 'vs-installer.exe' recently)

    0 讨论(0)
  • 2021-01-07 18:36

    Here's some PowerShell that fixed this issue for me by adding in the missing reference in MSBuild.exe.config on my Build server. Adjust paths to your VS version / targets path.

    [xml]$msbuild_config = Get-Content -Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe.config"
    $webApplicationTarget = $msbuild_config.configuration.msbuildToolsets.toolset.property[0].Clone()
    $webApplicationTarget.name = "MSWebApplicationTargets"
    $webApplicationTarget.value = "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications"
    $msbuild_config.configuration.msbuildToolsets.toolset.AppendChild($webApplicationTarget)
    $msbuild_config.save("C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe.config")```
    
    0 讨论(0)
  • 2021-01-07 18:37

    You need to either...

    1. Install Visual Studio on your build machine, or
    2. Manually copy the contents of the MSBuild\Visual Studio\v10.0\WebApplications folder to the same location on your build machine.
    0 讨论(0)
  • 2021-01-07 18:37

    I saw the same error when setting up continuous integration with Jenkins. I was able to add a command-line argument to MSBUILD: /p:VisualStudioVersion=12.0 because I had Visual Studio 2012 installed on my build server.

    0 讨论(0)
提交回复
热议问题