简体   繁体   中英

How to deploy an MVC application on IIS 7?

I have a MVC application and I can't get it working on IIS 7. Debugging in VS2010 works fine, but when I publish the website to my local IIS7, I see nothing but blank pages.

Here is what I have done:

On the project, right click and click Publish. In the Publish Web window I set these settings:

  • Publish method: Web deploy
  • 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 checked.

In IIS, my application runs under a application pool with supports .net 4.0 and managed pipeline is set to integrated.

I don't get any error while publishing, but when I navigate to my site I only see blank pages. Nothing happens.

What goes wrong?

EDIT:

When I navigate to http://localhost/Africa/ I see a blank page. When I navigate to http://localhost/Africa/Views/Home/ I get a 500 error.

How can I solve this?

I ran in to the same exact problem, it took quite a bit of digging to solve.

I finally found the solution to it on this page: Getting an ASP.MVC2/VS2010 application to work in IIS 7.5

Yeah, I know that this is an old thread but for the sake of saving someone else's time I'm adding this. Also make sure you have HTTP Errors, HTTP Redirection, and Static Content enabled in IIS.

In your application pool advanced settings, make sure you have Enable 32-bit applications set to true.

Some other things to try:

Change the application pool to classic.

Make sure you have the correct version of MVC installed on your server.

If you are getting 500 errors, you can turn on Failed Request Tracing and check the logs. If you are getting 500 errors and no logs are being created, you need to check your web.config.

Blank page normally doesn't necessary mean it's not working, if you default page doesn't have anything, it will be blank.

If you run into some error, you normally will see an error page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM