How to deploy an MVC application on IIS 7?

I have an MVC application and I can’t get it to work with IIS 7. Debugging in VS2010 works fine, but when I publish a site on my local IIS7, I see only blank pages.

Here is what I did:

In the project, right-click and select Publish. In the Web publishing window, I set the following settings:

  • Publishing Method: Web Deployment
  • Service url: localhost
  • Site / application: default Web Sit \ Africa
  • both, Mark as IIS application on destination and Leave extra files on destination (do not delete are Leave extra files on destination (do not delete .

In IIS, my application runs under an application pool with support for .net 4.0, and the managed pipeline is configured for integration.

I don’t get any errors during publication, but when I go to my site, I see only blank pages. Nothing happens.

What's wrong?

EDIT:

When I go to http: // localhost / Africa / , I see a blank page. When I go to http: // localhost / Africa / Views / Home / , I get 500 errors.

How can i solve this?

+4
source share
3 answers

I faced the same exact problem, it took a lot of effort to solve it.

Finally, I found a solution on this page: Getting an ASP.MVC2 / VS2010 Application to Work in IIS 7.5

Yes, I know this is an old thread, but for the sake of saving someone else I am adding this. Also make sure that IIS includes HTTP errors, HTTP redirection, and static content.

+2
source

In the advanced application pool settings, make sure Enable 32-bit applications is set to true.

Some other things to try:

Change the application pool to classic.

Make sure that the correct version of MVC is installed on your server.

If you get 500 errors, you can enable Failed Request Tracing and check the logs. If you get 500 errors and no logs are generated, you need to check your web.config.

+2
source

A blank page is usually not needed, which means it does not work, if you do not have a page by default, it will be blank.

If you encounter some kind of error, you will usually see an error page.

+1
source

All Articles