I am trying to start an ASP.NET 5 MVC 6 HelloMVC project using a special CSS file.
I place the .css files in a folder wwwroot, say in a folder styles.
I then refer to it in his _Layout.cshtmlwith
<link rel="stylesheet" href="~/styles/mystyle.css" />
However, the style is not displayed.
If I go to the URL of the expected file in my browser (let's say I work on port 12345, so I go to http://localhost:12345/styles/mystyle.css, I am greeted by a sassy page (pure HTML) with a light bulb and an emoticon that says " Your ASP.NET 5 application has been successfully started".
In fact, if I go to any URL to launch the application, I am greeted with the same page. those. going to http://localhost:12345/thisfiledoesntexist.jpgwill return the same page.
Is this ASP.NET 5 page current 404? Why are my styles not showing? I would think that it will be a very simple thing.
Looking at this question , it seems that what I am doing will be right. In fact, Visual Studio even has intellisense for the css files that I added when I entered href.
source
share