Open benmcmorran opened 1 year ago
This will not be a problem in .NET 8 anymore: https://github.com/dotnet/runtime/pull/89333
You could workaround it even now - install a preview version of .NET 8 (or ideally RC1 when it comes out soon). It will add a newer version of hostfxr
with the change and should work regardless of the version of the SDK your project is meant to use.
I think this has been discussed before (Can't find the issue), it happens because the windows update tried to remove the old patch while it was in use, so instead it scheduled file removal upon reboot. But that will only remove files and not directories. I'm no expect on this - so maybe somebody who knows the specific details can chime in here.
Describe the bug
I have a project using .NET SDK 7.0.200 via a global.json file which specifies
"rollForward": "patch"
. Windows Update periodically updates the installed version of the SDK on my machine to 7.0.203, presumably to address security vulnerabilities. However, when this update happens, it deletesC:\Program Files\dotnet\sdk\7.0.200\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props
but does not delete the containing directoryC:\Program Files\dotnet\sdk\7.0.200\Sdks\Microsoft.NET.Sdk\Sdk
. This confuses MSBuild into thinking that the 7.0.200 SDK is still available, which breaks my build.To Reproduce
msbuild
on the command line to build the project.Exceptions (if any)
None.
Further technical details
dotnet --info
A ProcMon trace shows MSBuild discovering the partially removed 7.0.200 installation: