Skip to content
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

WebCompiler does not work with dotnet watch anymore if using .NET 8 SDK #95

Closed
JustusGreiberORGADATA opened this issue Sep 5, 2024 · 3 comments

Comments

@JustusGreiberORGADATA
Copy link

Hi,

I create this issue more to document the issue for others, rather than to ask for a fix:

Because of changes in .NET 8 SDK the dotnet watch mechanism can no longer run arbitrary commands:

https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-watch#arguments
dotnet/sdk#38340

This means dotnet watch tool webcompiler will secretly result in dotnet watch run tool webcompiler, which will start the current project with the arguments tool webcompiler instead of running webcompiler directly. I guess if you have setup the current project to run webcompiler on build it technically still kind of works, but certainly not as intended 😄.

@JustusGreiberORGADATA
Copy link
Author

Oh I'm quite proud of myself, I found a dirty f-ing hack 🙃.

If you have setup webcompiler to run as part of a MSBuild Target, you can just watch that and it still kind of works.

dotnet watch build -t:CompileStaticAssets --no-restore

Probably not as fast, because of the MSBuild overhead, but at least it is not a full build 👍.

@stefanloerwald
Copy link
Member

Thanks @JustusGreiberORGADATA. That workaround looks good enough for me. What a shame that running dotnet tools was dropped!

@mrgiff
Copy link

mrgiff commented Sep 7, 2024

Oh I'm quite proud of myself, I found a dirty f-ing hack 🙃.

@JustusGreiberORGADATA - loving your dirty f-ing hack! 😊 Many thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants