-
Notifications
You must be signed in to change notification settings - Fork 113
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
IIS published Blazor .NET8 app fails to deliver styles and scripts on first device connection #292
Comments
My first time using this library and I hit the same issue today. I'm using the latest version of everything. After creating the missing path the error goes away and the site becomes usable. Strange note: No cache files are ever created there! So it's throwing an unrecoverable error that crashes the site for all users and then it's not even using the cache folder. I would not consider this exceptional. It needs to log the error and then have a graceful fallback to a different method. Especially when this folder isn't in use! |
I have the same on Plesk Shared Hosting (Not blazor, Asp.Net Core MVC 8). I asked server and CDN supportand they didn't found any error and told me that my code has problem. but I wonder What is the problem! I searched everywhere and then for testing, I commented WebOptimizer from program.cs and everything works fine. a fix would be nice! Here is the Image after the user opens the page for the first time, no matter desktop or mobile user: as you can see HTML is rendered and images and other static files loaded except CSS and JS files with error 500. After reloading everything is going to be fine and fast. another thing I found is that after IIS Idle timeout, this problem happens again for the users. (because it's going to start again) |
Any update on this? On publish to an Azure Web App, same issue. First load of bundled items return http code 500's. If you keep refreshing the page, eventually they 200...
|
I discovered a workaround (though not optimal). Disable the disk cache entirely. Be sure to set all option properties explicitly. I assumed I wouldn't have to set other option properties outside of EnableDiskCache = false. However the other properties did not keep the documented defaults, seems they all were all set to false. |
Hello!
We have a Blazor app running .NET 8 on a Windows Server published through Visual Studios IIS publish option.
We used WebOptimizer in our Program.cs and then started noticing that
After some digging in the Windows Error logs i saw several errors popping up for each of the failed files that the browser tried to download.
App.razor:
<link rel="stylesheet" href="/css/app.min.css" />
Example for app.min.css
This causes a chain reaction and prevents the download of all files.
The published Blazor page does not contain an \obj\WebOptimizerCache folder and WebOptimizer fails to create this folder.
FIX:
Manually adding this folder solves all the problems but i wonder what is causing this because the IIS User has all the permissions required. If this is all expected behaviour the documentation should be updated and reflect that it is necessary to create this folder structure to use the WebOptimizer.
The text was updated successfully, but these errors were encountered: