-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet watch run completely broken for F# #44908
Comments
cc @tmat |
Noticed that as well and I assumed I messed up my setup |
This would be extremely undesirable to leave in for any period of time - F# web applications rely heavily on this (the entire SAFE Stack is built upon a watch mode for both client and server for example). |
Also dotnet aspire is broken for F# users. |
Using the Roslyn MSBuild APIs directly likely won't work for any project type that is non-Roslyn. I'd expect watch for esproj for example to be broken similarly based on this stack. |
Nothing actionable for us here, unfortunately, Roslyn/watch team needs to fix it. |
Also, I assume --no-hot-reload still works? It should be automatically enabled for F# projects |
Yes, a workaround is to pass |
How is that a workaround? |
@forki Passing |
Proper hot reload was never supported in F#. @tmat do you know what changed to default behaviour, so it's failing in F# now, did |
Well it worked in fable. But yes for dotnet watch run, changes in fsproj or fs files did a recompile and restart. Which would be OK if this works properly again |
Even if that were the case, it should only be on-by-default for C# projects - the rest of everything will break, and there's no need to enforce an extra cmdline parameter on everyone because of this. |
@isaacabraham What about F# projects that have C# dependencies and vice versa? Would you expect Hot Reload work for C# code and trigger rebuild for changes in F# code? |
For anyone else affected by this issue, my workaround is to add the following file: global.json {
"sdk": {
"version": "8.0.100",
"rollForward": "latestMinor",
"allowPrerelease": false
}
} |
Describe the bug
Using
dotnet watch run
does not work for F# applications. It won't start the application at all.This is the output I get:
At this point, the application should be running, but isn't. Notice how it is trying to use hot reload which doesn't support F#.
When I make a change to the application code (which should trigger a standard watch run restart), sure enough I get this:
Fsproj is indeed associated with a language - F#. It's just that hot reload doesn't know about it. It's completely broken.
Using
dotnet run
works, thankfully:To Reproduce
I have an F#9 project which uses the Web SDK. It doesn't use anything else really - standard nuget etc.
Further technical details
dotnet --info
Running on Win 11.
The text was updated successfully, but these errors were encountered: