The imported project Microsoft.WebApplications.targets was not found

后端 未结 10 1065
野的像风
野的像风 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: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")```
    

提交回复
热议问题