Hello everyone, this error has occurred - enter image description here

Microsoft recommends fixing this as follows: Solution from Microsoft

but the problem is that the path indicated in the article

% windir% \ System32 \ inetsrv \ config \ applicationHost.configŃ–

I have neither the \ config folder, nor the applicationHost.config file itself - in which they offer to make salutary changes to solve the problem.

What to do?


Has moved from a dead point - the following has helped:

<security> <requestFiltering> <fileExtensions allowUnlisted="true"> <add fileExtension="." allowed="true" /> <remove fileExtension=".cs" /> </fileExtensions> </requestFiltering> 

- Ie, "stupidly" set filters for file extensions - removing them with remove and setting allowUnlisted="true" notorious instructions from Microsoft, I mentioned above — do not help, but only interfere. Now gives an error

HTTP Error 404.0 - Not Found

    1 answer 1

    So it should be - you in the browser indicated the path to the source code, http: // localhost: 49525 / Home / UsersController.cs .

    Most likely you have this file set as "start" in the project settings - you accidentally clicked on it to set as startup page in the solution explorer.

    Security settings do not allow you to extract the source code as text, and you try to break them in response. Just delete UsersController.cs from the address bar - and your application will open.

    Do not forget to roll back the changes in the filtering settings to the standard ones and correct the project settings so that the studio does not open the wrong URL on launch.

    • How to fix filtering settings? - BadCatss
    • @ Html.ActionLink ("Registration", "UsersController.cs", new {area = ""}, new {@class = "navbar-brand"}) @ {var thing = @ Scripts.Render ("F: / Visual Studio Projects / WebForum / WebForum / Controllers / UsersController.cs / ViewPartial "); } <br> - BadCatss
    • I specify the controller myself in the ActionLink link - BadCatss
    • one
      @badcats ASP.NET MVC is not PHP. In MVC there is a routing system. You need to specify a link to the route, and not call all methods at random. Your code is trying to render the contents of the cs file inside the link tag. Take the standard template project and see how registration links are made there. - PashaPash ♦