Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSS file not loading Core 3.0

See original GitHub issue

After upgrading my project to the release of Core 3.0 the css file no longer loads and just returns an empty page.

I was able to reproduce this on the demo project in the repo just by upgrading it to core 3.0. I had to comment out

     app.UseMvc(routes =>
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");

to run the project.

EDIT: setting o.ConfigureKestrel(options => options.AllowSynchronousIO = true); fixes the issue, but i am guessing is not a good solution

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

NickBransteincommented, Jan 21, 2020

I had this same issue when using IIS so I do not think it is fully fixed. Instead of turning on SyncIO for the entire server you can combine the two above solutions and turn it off for specific requests.

app.UseWhen(context => context.Request.Path.StartsWithSegments("/elmah", StringComparison.OrdinalIgnoreCase), appBuilder =>
                appBuilder.Use(next =>
                    return async ctx =>
                        ctx.Features.Get<IHttpBodyControlFeature>().AllowSynchronousIO = true;

                        await next(ctx);

JonBraundcommented, Nov 12, 2019

I found this problem wasn’t solved by the keerthiraja1988’s code snippet when using IIS with the .net core 3 hosting bundle as kestrel doesn’t seem to be relevant. Instead this similar snippet worked for me in ConfigureServices in startup.cs

services.Configure<IISServerOptions>(options => { options.AllowSynchronousIO = true; });

Hope this helps someone

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are most of my CSS files not loading when using an ...
I am using ASP.NET Core 3.1. I have the following in every HTML file I will be using. <link rel="stylesheet" href="~ ...
Read more >
Why js,css,lib didn't load from wwwroot?
I made a simple ASP MVC (Net Core 3.1) , I leave it as standard, and deploy it under a subfolder of the...
Read more >
CSS file not loading on specific computer : r/HTML
Open the developer tools in the browser and go to the Network tab. Reload the page and watch for any 400 or 500...
Read more >
Solving the React Error: Not Picking Up CSS Style
In this guide, you will learn about the errors that can occur while importing a CSS file into your React file.
Read more >
Ojs not loading css - Software Support - PKP Community Forum
I'm trying to host ojs inside a digital ocean server, with nginx, but my css does not load and when I try to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found