Open kanadaj opened 3 years ago
Thanks for contacting us.
We're moving this issue to the Next sprint planning
milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
You'll want to exclude Content
items from being watched. Removing it doesn't quite work because they're not in the Watch
item group during global evaluation:
<ItemGroup>
<!-- exclude all Content items from being watched -->
<Content Update="@(Content)" Watch="false" />
</ItemGroup>
I've added a note to our docs to include this snippet: https://github.com/dotnet/AspNetCore.Docs/pull/21858/files
@pranavkm This seems like an undocumented change as the documentation says: https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/tutorials/dotnet-watch.md#customize-files-list-to-watch
By default, dotnet-watch tracks all files matching the following glob patterns:
**/*.cs *.csproj **/*.resx
with no mention of Content files
Good catch. I've updated the PR to include this.
Since it's also a new thing (either introduced with 5.0 or after 5.0, not entirely sure whether it's a major version or a patch, only noticed it in the current version) I don't remember seeing it in any of the changelogs either, I'd probably note this change somewhere in the changelogs?
Just an update on this one since the other ticket was moved here and then closed; based on https://github.com/dotnet/sdk/pull/15405 and https://github.com/dotnet/aspnetcore/pull/27744 the addition of content files to watch was no meant to cause a full app recompilation but rather was done for browser link to reload CSS files. The app recompilation is likely an unintended, unwanted side effect, so rather than a documentation change, this seems to be a bug in need of fixing.
Just an update on this one since the other ticket was moved here and then closed; based on dotnet/sdk#15405 and #27744 the addition of content files to watch was no meant to cause a full app recompilation but rather was done for browser link to reload CSS files. The app recompilation is likely an unintended, unwanted side effect, so rather than a documentation change, this seems to be a bug in need of fixing.
I've been evaluating this feature using the ASP.NET MVC template in version 5.0.301. Changes to site.css or site.js does not recompile the project, it only hot reloads the changed files as expected.
I am getting a JavaScript Uncaught TypeError: styleElement is null error in aspnetcore-browser-refresh.js when changing site.css though.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Describe the bug
Running on .NET 5.0.201,
dotnet watch run
reloads every time a JS or CSS files is modified in wwwroot even though I have no configuration that would tell it to do so.dotnet watch --list
lists all files under wwwroot as well.Adding
doesn't help.
To Reproduce
I can reproduce the issue with a brand new project:
.NET SDK (reflecting any global.json): Version: 5.0.201 Commit: a09bd5c86c
Runtime Environment: OS Name: Windows OS Version: 10.0.19042 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.201\
Host (useful for support): Version: 5.0.4 Commit: f27d337295
.NET SDKs installed: 3.1.302 [C:\Program Files\dotnet\sdk] 3.1.402 [C:\Program Files\dotnet\sdk] 5.0.100 [C:\Program Files\dotnet\sdk] 5.0.101 [C:\Program Files\dotnet\sdk] 5.0.102 [C:\Program Files\dotnet\sdk] 5.0.103 [C:\Program Files\dotnet\sdk] 5.0.201 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.All 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]