-
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
}
} |
@tmat That would be nice. But either way you cannot have, by default, F# projects suddenly broken with .NET Watch i.e. a massive breaking change that has not been documented at all. |
IOW - don't use .NET 9? I think the workaround to explicitly turn off hot reload is better but still extremely undesirable. |
I am in the middle of a very large project using a net8 F# web api. |
That makes sense. I would suggest as a matter of course always having a |
Does anyone know what does 'Hot reload' feature do exactly, and how does C# work differently than F# in this regard? BTW, there's an option to disable it on a per project basis, but I'm not sure if this only works for ASP.NET applications: |
No need to switch to .NET 8. You can pass |
This workaround also seems to work for VB.NET. |
That's right, this issue impacts all non-C# projects that work with MSBuild AFAIK. |
Just want to chime in that I have also run into this issue (I guess every non-C# user will). |
I am having a similar issue with my C# only web app still targeting .NET 8. --no-hot-reload is working as a workaround. When I say similar, I mean it hits part of the same stack trace...
|
I'm facing exact same error in c# |
In the case of Aspire --no-hot-reload makes things even worse. Then a change in a subproject is making the whole apphost rebuilding and restarting services. It can't even open new ports and everything is broken. |
For me --no-hot-reload doesn't work at all. I get a different error message when I modify a static file in webroot
Oh and this is reported here |
Fixed by #44928 in 9.0.1xx |
I installed the sdk for the fix: dotnet --info Runtime Environment: Unfortunately, I stil run into the 'fsproj' is not associated with a language error:
|
@tmat Could you please open this? Since it's not fixed? |
I don't have permissions to reopen the issue, that's why I created the new issue with reference to the old one. |
This should be fixed in January's servicing release - the fix was made but due to slower release schedules over the holiday season it won't be released until then. There's nothing wrong or out of the ordinary with this - many fixes across the CLI are in the same bucket. |
@baronfel : sorry about that, thought this was fixed in the release I was on. Enjoy the holidays! |
No problem at all! The release schedule isn't the most transparent thing in the world, I know :( In any case, happy holidays! |
Here to report that this is still a problem in the latest servicing update released on January 14.
Uninstalling the dotnet 9 SDK for the time being until this can get resolved. |
@baronfel with 9.0.200 it's still broken. This issue should be reopened |
I use this feature mainly with the SAFE stack. And with the 9.0.200 version it seems fixed. |
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: