Open isaacabraham opened 1 month ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
I was having the same issue with dotnet watch run
and I saw the following in Event Viewer:
Application: dotnet.exe
CoreCLR Version: 4.700.22.55902
.NET Core Version: 3.1.32
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.Reflection.RuntimeAssembly.GetType(QCallAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive, ObjectHandleOnStack assemblyLoadContext)
at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
at System.StartupHookProvider.CallStartupHook(StartupHookNameOrPath startupHook)
at System.StartupHookProvider.ProcessStartupHooks()
Along with sdk versions 6 and 8, I had sdk 3.1 installed, as part of VS2019, so I uninstalled it (using dotnet-core-uninstall
which advised that the uninstall would break VS2019) and now dotnet watch run
and dotnet build
appear to be working normally with a global.json that specifies sdk 8.0.403.
This is related to this issue, around a breaking change somewhere after .NET 8.0.206 that is impacted (as far as I can tell) from the following convergence:
Microsoft.NET.Sdk.Web
SDK.If all of these things are true and you
dotnet watch build
orrun
from the folder of the project, things go wrong. I suspect it's something that's changed since 8.0.206 (or the Sdk.Web) that has somehow broken Paket.We have seen this with multiple customers of SAFE Stack, which uses Paket and ASP .NET Core - when people upgraded to 8.0.3xx, things started going wrong with no code changes at all.
This repository contains a working reproduction of the issue using F#, whilst this repository contains an even simpler repro of the issue using C#.
Here are some steps to reproduce:
cd
to it.dotnet new globaljson
dotnet new console -lang F#
dotnet tool install paket --create-manifest-if-needed
dotnet paket add FSharp.Core
Now, observe the following behaviours:
dotnet watch build ❌
dotnet watch run
❌Workarounds
watch
;dotnet build
anddotnet run
on their own work. ✅global.json
to pin to 8.0.206. ✅fsproj
SDK toMicrosoft.NET.Sdk
✅--no-restore
to eitherwatch run
orwatch build
. ✅Observations
dotnet watch
after 8.0.206 of the SDK. That's the last working version of .NET 8 that I could find.dotnet build
anddotnet run
. This shouldn't be the case.cc: @baronfel - he has been unable to reproduce this on his machine at all :-(