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

Fix MAUI static asset updates #47431

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BuiltInTools/dotnet-watch/DotNetWatch.targets
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Returns: @(Watch)
<!-- In RazorSDK (Blazor, RCL, and Web) targeting apps also watch content files under wwwroot -->
<Watch Include="%(Content.FullPath)"
Condition="'$(UsingMicrosoftNETSdkRazor)'=='true' AND '$(DotNetWatchContentFiles)'!='false' AND '%(Content.Watch)' != 'false' AND $([System.String]::Copy('%(Identity)').Replace('\','/').StartsWith('wwwroot/'))"
StaticWebAssetPath="$(_DotNetWatchStaticWebAssetBasePath)$([System.String]::Copy('%(Identity)').Replace('\','/').Substring(8))" />
StaticWebAssetPath="$(_DotNetWatchStaticWebAssetBasePath)$([System.String]::Copy('%(Identity)').Replace('\','/'))" />

<_WatchProjects Include="%(ProjectReference.Identity)" Condition="'%(ProjectReference.Watch)' != 'false' and Exists('%(Identity)')" />
</ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,8 @@ public async Task Razor_Component_ScopedCssAndStaticAssets()

await App.AssertOutputLineStartsWith("dotnet watch 🔥 Hot reload change handled");

App.AssertOutputContains($"dotnet watch ⌚ Sending static asset update request to browser: 'app.css'.");
// "wwwroot" directory is required for MAUI. Web sites work with or without it.
App.AssertOutputContains($"dotnet watch ⌚ Sending static asset update request to browser: 'wwwroot/app.css'.");
App.AssertOutputContains($"dotnet watch 🔥 Hot reload of static files succeeded.");
App.AssertOutputContains(MessageDescriptor.NoCSharpChangesToApply);
App.Process.ClearOutput();
Expand Down
Loading