aspnetcore: Static assets request path problems in preview6
Describe the bug
In preview 6 when there is a wwwroot folder in a blazor library project, the request path of server side and client side are different.
To Reproduce
Steps to reproduce the behavior:
dotnet newa blazor library project with a name that contains..- Rename the
contentfolder towwwrootto make use of the new static assets feature add in preview6. - Change the references in the csproj file of the library project to use
wwwrootinstead ofcontent(There would even not be any proper url path to the assets with client side hosting if this step is skipped. Question: Why doesn’t blazor client side use the new wwwroot support? ) dotnet newa blazor client side and a blazor server side project that reference the library project.- Run and test both project.
Expected behavior
Static assets in both project can be accessed with the same url path.
Actual behavior
The file “background.png” is accessed with different url path:
Client side hosting: https://<hostname>/_content/<TheOriginal.LibraryName>/background.png
Server side hosting: https://<hostname>/_content/<lowercaselibrarynamewithoutdots>/background.png
Consequence
A blazor library with static assets cannot have a name with ., otherwise it would have different behavior when referenced by client side and server side hostings.
Is there any plan to fix this fault in the futural preview, or some quick fix for the current version?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 26 (16 by maintainers)
@javiercn I am still confused that the
razorclasslibtemplate creates a library with .cshtml files while blazor uses .razor files. Does cshtml work also with blazor? And therazorclasslibtargetsnetcoreapp3.0while the client-side blazor template targetsnetstandard2.0. How could a blazor project reference a razor class library project?@karthickthangasamy Me too.