0

I tested the default MVC template that visual 2017 provides, and tested it on IIS 10,in my local machine, and works great.

When I test it on Windows server 2012 R2 (IIS 8.5) or in Windows server 2008 (IIS 7) I get a lot of errors and all I can do is see a list of the files in the root directory instead of the rendered website.

What I do to get the webste that IIS 10 is able to run is to Debug tth aplicationn in visual studio, then I find the path of that app, that IIS express is using, and then copy it to a folder that IIS has access to, in IIS 10 it works great, in IIS 7.0 and in IIS 8.5 and can't get it to work.

listed elements

Pease help. What can I do?

Update:

I'm currently installing updates on the w2012r2 system, which includes updates in .net framework

newbie
  • 101
  • 5

2 Answers2

1

There is nothing you have to do with your MVC app to make it work with IIS 7 - 10.

You just need to make sure the Server and IIS is configured correctly:

  • Make sure the .NET version you require is installed on the server.
  • Make sure ASP.NET is installed as part of IIS.
  • Make sure the application pool you are using is set to your Framework version.
  • You should also turn off Directory browsing on a production server.

There are many resources on the net on how to configure IIS and ASP.NET

I get a lot of errors

is not very helpful if you want people to help you, you need to list the errors in detail.

Peter Hahndorf
  • 14,058
  • 3
  • 41
  • 58
0

So I finally ended up solving this.

I had to allow directory browsing in IIS 7.

Also added in my web.config file the following lines.

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/> 
</system.webServer>

Finally, I had to run the following command: (explanation)

aspnet_regiis.exe /iru

newbie
  • 101
  • 5