-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Summary
In dotnet/sdk#53005 a user was running builds with MSBuildExtensionPaths set to C:\Program Files (x86)\MSBuild - a location that very likely didn't exist or would not have worked for them. We should detect scenarios where incorrect or missing critical paths are involved in the build and fail or raise warnings earlier on.
Background and Motivation
If we can detect invariants/key dependencies earlier on (e.g. MSBuildExtensionsPath is specified but does not exist, or the MSBuild Sdks root is specified, does not exist, and is needed) and raise those to users so they don't end up running hopeless builds.
Proposed Feature
We should have logic in the common targets and/or the engine that validates the existence of the critical locations:
MSBuildExtensionsPathMSBuildSDKsPath
If these locations do not exist (and are required for the build, so always for MSBuildExtensionsPath and when resolving SDKs for MSBuildSDKsPath) then we should log an error.
In addition, if these locations are set to unexpected locations (i.e. outside the SDK/VS install roots/etc, we should have a buildcheck or something to flag that - any use outside of those contexts is very likely incorrect.
Alternative Designs
No response