-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Static file, multiple locations #32891
Comments
Hello @ventureaaron ... Please open this for the product unit at ... https://github.com/dotnet/aspnetcore/issues ... with a few updates ...
@Rick-Anderson ... I'll relabel this issue for the Blazor article and assign to myself for work. |
Thanks for your patience and instruction.
I’ve submitted that issue over there:
#32895
Hope it helps!
…-aaron
From: Luke Latham ***@***.***
Sent: Wednesday, June 19, 2024 3:34 AM
To: dotnet/AspNetCore.Docs ***@***.***>
Cc: Aaron Little ***@***.***>; Mention ***@***.***>
Subject: Re: [dotnet/AspNetCore.Docs] Static file, multiple locations (Issue dotnet/aspnetcore#32891)
Hello @ventureaaron <https://github.com/ventureaaron> ...
Please open this for the product unit at ...
https://github.com/dotnet/aspnetcore/issues
... with a few updates ...
* Tell them that you're referring to this section for use with a Blazor Web App 👉 https://learn.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-8.0#serve-files-from-multiple-locations
* When you post your code use triple-backticks above and below your code block for formatting in a GH comment with the C# code language ("```csharp" on a line before your code ... then your code ... then on another line after with "```"). See: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#quoting-code
* Please add the following to your OP so that I can follow the discussion. If we make a documentation change, it will be to add content on this to the Blazor Static Files article ...
* cc: @guardrex #32891
@Rick-Anderson <https://github.com/Rick-Anderson> ... I'll relabel this issue for the Blazor article and assign to myself for work.
—
Reply to this email directly, view it on GitHub <#32891 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAUNZIHNU2E2VSYHXADCRW3ZIE67LAVCNFSM6AAAAABJRIW3VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZYGA4DQMBVGQ> .
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Sorry that it didn't work out the way that I expected. Our normal workflow would've been to get an answer on the product unit's repo that I could then work into the Static Files article here if it turns out to be a special case for Blazor apps. Your issue was transferred back over here. I sent an email to Artak to ask him what the plan is for this issue. I'll comment back here after he lets me know how this one is going to be handled. |
I probably did something wrong. Let me know if I need to resubmit anything or how else I can help.
From: Luke Latham ***@***.***
Sent: Wednesday, June 19, 2024 12:20 PM
To: dotnet/AspNetCore.Docs ***@***.***>
Cc: Aaron Little ***@***.***>; Mention ***@***.***>
Subject: Re: [dotnet/AspNetCore.Docs] Static file, multiple locations (Issue #32891)
Sorry that it didn't work out the way that I expected. Our normal workflow would've been to get an answer on the product unit's repo that I could then work into the Static Files article here if it turns out to be a special case for Blazor apps. Your issue was transferred to the .NET docs. I sent an email to Artak to ask him what the plan is for this issue. I'll comment back here after he lets me know how this one is going to be handled.
—
Reply to this email directly, view it on GitHub <#32891 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAUNZIB63LHH6DERYQBT2DTZIG4URAVCNFSM6AAAAABJRIW3VOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZZGIYDAMBSGY> .
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Let's wait for Artak to respond to my email. I'll report back when I hear from him. |
There was no response to my email. I'm going to see if I can repro this, and I'll send Artak another email to ask how he wants to proceed. His transferred issue (your PU issue) is now a duplicate here, and I don't think Javier sees the pings from this repo ... i.e., your issue has "gone into a black hole" at the moment 😆. I'll see if I can get some action going on this. |
Confirmed that this is only a problem for BWAs (Blazor Server works with the approach in the main doc set article). Your approach ... var secondaryProvider = new PhysicalFileProvider(
Path.Combine(builder.Environment.ContentRootPath, "MyStaticFiles"));
app.Environment.WebRootFileProvider = new CompositeFileProvider(
app.Environment.WebRootFileProvider, secondaryProvider); ... ✨ Just Works!™ ✨ ... and seems fine with me as a suggested alternative. I'm going to close the transferred issue and work from this issue. I'll take the following actions ...
|
[EDIT by guardrex to update the metadata]
Description
In the final blazor example for serving from multiple locations, the compiled css file seems to get lost (appname.styles.css). Debugging the webrootfileprovider seems to indicate the culprit is the Microsoft.AspNetCore.StaticWebAssets.ManifestStaticWebAssetFileProvider dropping out when we replace the webrootprovider with the compositeProvider in the example.
I worked around this with this below, but it's almost certain to not be the proper way:
Cheers on fantastic documentation! Really appreciating all the efforts.
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/static-files?view=aspnetcore-8.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/fundamentals/static-files.md
Document ID
25458428-030f-6acb-457e-1b4dfa722043
Article author
@guardrex
The text was updated successfully, but these errors were encountered: