Prep a bootstrap MSBuild layout using build /p:CreateBootstrap=true
or download the one I used from:
https://kirillosenkovfiles.blob.core.windows.net/kirillosenkovblob/msbuild.17.3.1.zip
Be on an empty Windows machine, such as Windows Sandbox VM
Create and build a new C# console app targeting net472
Expected: builds successfully
Actual:
Build FAILED.
C:\Users\WDAGUtilityAccount\AppData\Local\Bootstrap\MSBuild\Sdks\Microsoft.NET.Sdk\targets\Mic
rosoft.NET.Sdk.ImportWorkloads.props(14,3): error : Unable to locate the .NET SDK. Check that it is installed and that
the version specified in global.json (if any) matches the installed version.
C:\Users\WDAGUtilityAccount\AppData\Local\Bootstrap\MSBuild\Sdks\Microsoft.NET.Sdk\targets\Mic
rosoft.NET.Sdk.ImportWorkloads.targets(16,3): error : Unable to locate the .NET SDK. Check that it is installed and tha
t the version specified in global.json (if any) matches the installed version.
The two SDKs it can't resolve:
Resolving SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator'...
Resolving SDK 'Microsoft.NET.SDK.WorkloadManifestTargetsLocator'...
First off, the error messages are inadequate - they don't mention the SDK reference that failed to resolve.
Both of these are supposed to resolve from:
https://github.com/dotnet/sdk/blob/3dc5e528fffc050cace4cff8bc32954eb33f0455/src/Resolvers/Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver/CachingWorkloadResolver.cs#L121-L136
However on an empty machine with just the xcopied MSBuild something goes awry apparently and it fails with the obscure messages above.
Until recently, the bootstrap MSBuild was xcopyable, meaning it used to build desktop-targeting projects on a completely empty Windows machine.
At some point this regressed. It is crucial that we continue to be able to have xcopyable MSBuild and we should move towards making MSBuild more portable, not less.
Prep a bootstrap MSBuild layout using
build /p:CreateBootstrap=trueor download the one I used from:
https://kirillosenkovfiles.blob.core.windows.net/kirillosenkovblob/msbuild.17.3.1.zip
Be on an empty Windows machine, such as Windows Sandbox VM
Create and build a new C# console app targeting net472
Expected: builds successfully
Actual:
The two SDKs it can't resolve:
First off, the error messages are inadequate - they don't mention the SDK reference that failed to resolve.
Both of these are supposed to resolve from:
https://github.com/dotnet/sdk/blob/3dc5e528fffc050cace4cff8bc32954eb33f0455/src/Resolvers/Microsoft.NET.Sdk.WorkloadMSBuildSdkResolver/CachingWorkloadResolver.cs#L121-L136
However on an empty machine with just the xcopied MSBuild something goes awry apparently and it fails with the obscure messages above.
Until recently, the bootstrap MSBuild was xcopyable, meaning it used to build desktop-targeting projects on a completely empty Windows machine.
At some point this regressed. It is crucial that we continue to be able to have xcopyable MSBuild and we should move towards making MSBuild more portable, not less.