Hi,
This is more of a question, but I upgraded my solution to RC2 and am now getting the following:
Severity Code Description Project File Line Suppression State
Error The static web asset 'C:\Source\MyCompany.Blazor\MyCompany.Blazor\Client\wwwroot\favicon.ico' has a conflicting web root path '/wwwroot/favicon.ico' with the project file 'wwwroot\favicon.ico'. MyCompany.Blazor.Server C:\Program Files\dotnet\sdk\5.0.100-rc.2.20479.15\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets 208
I have a favicon in the root folder of both the client and the server. I'm guessing I can just delete one of them, but I wanted to understand what has changed between RC1 and RC2 because it was working OK before.
On a broader note, I do find the sharing of assets (Images, css, js etc) between Client and Server a bit confusing. If I put them all in just one place I lose intellisense in the other. Can you advise on best practice for sharing assets between the two?
@LaughingJohn thanks for contacting us.
This was an issue in the past too, just that the server file would silently override the client file. In RC2 as part of some changes we did, we "tuned" up the validation to ensure that no two assets end up in the same final path.
Normally this is not an issue for RCLs since their files are placed under "_content/$(PackageId)" by default, but in the case of blazor webassembly applications they are placed on the root folder, so these conflicts can present themselves more often, that's why we warn you when this happens, since otherwise the content on the server project will silently override the content on the client.
Ah, thanks @javiercn, makes sense. I did delete one and it all worked. Be nice to have some guidance around sharing resources between client & server projects, and maybe intellisense (for css, jss and file location) across projects.
Be nice to have some guidance around sharing resources, and maybe intellisense (for css, jss and file location) across projects.
@LaughingJohn Feel free to file an issue and post a comment here to see if it has other supporters. We are starting our plans for .NET 6.0 and we are looking for this type of feedback.
Having something like this will help us track the interest for the feature as well as specific improvements people is interested in.
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.
See our Issue Management Policies for more information.
I have started getting StaticWebAssets related error below for Blazorise Razor Class Library (RCL) packages as well in my Blazor Server project on build after updating my Microsoft Visual Studio Professional 2019 Preview to Version 16.8.0 Preview 5.0
`C:\Program Files\dotnet\sdk\5.0.100-rc.2.20479.15\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(208,5): error : The static web asset 'C:\Users\dimak.nuget\packages\blazorise.bootstrap\0.9.1.2\build..\staticwebassets\blazorise.bootstrap.css' has a conflicting web root path '/wwwroot/_content/Blazorise.Bootstrap/blazorise.bootstrap.css' with the project file 'wwwroot_content\Blazorise.Bootstrap\blazorise.bootstrap.css'.
So confirming the bug needs to be fixed. Really annoying to rollback VS...
Most helpful comment
@LaughingJohn thanks for contacting us.
This was an issue in the past too, just that the server file would silently override the client file. In RC2 as part of some changes we did, we "tuned" up the validation to ensure that no two assets end up in the same final path.
Normally this is not an issue for RCLs since their files are placed under "_content/$(PackageId)" by default, but in the case of blazor webassembly applications they are placed on the root folder, so these conflicts can present themselves more often, that's why we warn you when this happens, since otherwise the content on the server project will silently override the content on the client.