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

Blazor WASM RC2 - static web asset - conflicting web root path. #26928

Closed
LaughingJohn opened this issue Oct 15, 2020 · 5 comments
Closed

Blazor WASM RC2 - static web asset - conflicting web root path. #26928

LaughingJohn opened this issue Oct 15, 2020 · 5 comments
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved

Comments

@LaughingJohn
Copy link

LaughingJohn commented Oct 15, 2020

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?

@javiercn
Copy link
Member

@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.

@javiercn javiercn added area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question labels Oct 15, 2020
@ghost ghost added the Status: Resolved label Oct 15, 2020
@LaughingJohn
Copy link
Author

LaughingJohn commented Oct 15, 2020

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.

@javiercn
Copy link
Member

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.

@ghost
Copy link

ghost commented Oct 16, 2020

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.

@ghost ghost closed this as completed Oct 16, 2020
@dmitry-pavlov
Copy link

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...

@dotnet dotnet locked as resolved and limited conversation to collaborators Nov 21, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants