Split out from #103 (item 2).
Summary
When WebApplicationsTargetPath resolves to a path that does not exist (the common case under dotnet, where $(MSBuildExtensionsPath32) points at the .NET SDK instead of a Visual Studio install), the build fails with a cryptic, low-level error:
error MSB4019: The imported project "...\dotnet\sdk\x.y.z\Microsoft\VisualStudio\v18.0\WebApplications\Microsoft.WebApplication.targets" was not found.
Proposed change
Make the Microsoft.WebApplication.targets import conditional on Exists('$(WebApplicationsTargetPath)') and add an early target that emits a clear, actionable error (e.g. SYSWEB001) explaining how to fix it: install the Visual Studio / Build Tools "web development build tools" workload, build from a Visual Studio Developer command prompt, or set VSToolsPath / WebApplicationsTargetPath explicitly (e.g. computed via VSWhere in a CI pre-build step).
Note
This is intended as interim, in-SDK guidance. If Microsoft.WebApplication.targets becomes available as a separately packaged/released component from Microsoft (cc @twsouthwick), that would likely be the better long-term source and this could defer to it. See #104.
Split out from #103 (item 2).
Summary
When
WebApplicationsTargetPathresolves to a path that does not exist (the common case underdotnet, where$(MSBuildExtensionsPath32)points at the .NET SDK instead of a Visual Studio install), the build fails with a cryptic, low-level error:Proposed change
Make the
Microsoft.WebApplication.targetsimport conditional onExists('$(WebApplicationsTargetPath)')and add an early target that emits a clear, actionable error (e.g.SYSWEB001) explaining how to fix it: install the Visual Studio / Build Tools "web development build tools" workload, build from a Visual Studio Developer command prompt, or setVSToolsPath/WebApplicationsTargetPathexplicitly (e.g. computed via VSWhere in a CI pre-build step).Note
This is intended as interim, in-SDK guidance. If
Microsoft.WebApplication.targetsbecomes available as a separately packaged/released component from Microsoft (cc @twsouthwick), that would likely be the better long-term source and this could defer to it. See #104.