حل مشکل Project fails to load with error regarding Microsoft.WebApplication.targets

error : The imported project "$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" was not found. Also, tried to find "$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0" . These search paths are defined in "C:\Users\Apple\AppData\Local\Microsoft\VisualStudio\15.0_01b1eef1\devenv.exe.config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths.

برای رفع پیام خطای بالا کافیست که در فایل csproj خود خط زیر را پیدا کنید

  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
  </PropertyGroup>

و به این حالت تغییر دهید

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

حالا پروژه خود را reload کنید

 

 

امکان ارسال نظر برای این موضوع وجود ندارد