skip to Main Content

I’m trying to work on a personal project using ASP.NET Core and utilize IIS so I can simply refresh the page and see the changes take effect and make minor adjustments.

Every guide online seems to be about publishing the page and doesn’t seem to cover the development process. I have the basics of using IIS but can’t seem to figure out what directory to target select for the physical path, or how to get the cshtml pages to load in browser.

Can anyone help?

Tried:

  • Setting Default Web Site’s physical path to the root of the solution
  • Setting Default Web Site to the Views/Home directory
  • Adding an Application with the physical path set to the root of the solution
  • Setting .NET CLR version to "No Managed Code"

Was expecting the localhost page to display the index.cshtml page, however instead I get the following error:

*HTTP Error 404.17 – Not Found
The requested content appears to be script and will not be served by the static file handler.

Most likely causes:
The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.*

If someone could give me a link to how you do this that would be great, I don’t think that the publish settings need to be configured to do this but I could be wrong.

Edit: Should specify I’m using IIS on Windows 10 Professional.

2

Answers


  1. Chosen as BEST ANSWER

    Lex Li provided the information required to properly set up the live previewing in a comment on the question:

    "Adding an Application with the physical path set to the root of the solution" is the wrong step that leads to all following errors. If you want development support for ASP.NET Core on IIS, you only option is to use Visual Studio, learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/…" – Lex Li


  2. HTTP Error 404.17 – Not Found

    The requested content appears to be script and will not be served by the static file handler.

    For this error, please try installing the missing .net stuff under the the Add/Remove Programs, then reboot the server.

    This link may help you: HTTP Error 404 17 Not Found

    If it can’t be resolved, I suggest you use the failed request trace to see the detailed error message. The failedReqLog will provide the key error and warning, which will help you to identify the problem.

    This link provide the method to enable failed request tracing to capture the detailed error: Troubleshooting Failed Requests Using Tracing in IIS 7

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search