3

I have built an MVC 3 application and I have a Web Server 2008 on which IIS 7.5 is installed.

In IIS, I created a new Site and under which an Application then I deployed all my physical files on that application folder:

C:\inetpub\wwwroot\DeveloperToolsPortal\Application 

I have also configured my Application Pool so that it supports .NET 4. I also downloaded the MVC3 on this server from the asp.net/mvc3 website.

When I browse this application from IIS using the {0} url, I get the {1} error message:

{0}: http://localhost:85/Application/Home/Index
{1}: HTTP 500 Internal Server Error

The Site was configured to use port 85 as 80 was already taken by another Site.

I've also added the below configurations in the web.config file:

  <system.webServer>
       <httpErrors errorMode="Detailed" />
    <asp scriptErrorSentToBrowser="true"/>
  </system.webServer>
<customErrors mode="Off"/>

Why is this getting this error? How could I fix it? Which step/s have I missed in configuring my application?

I also tried another thing. I added a simple .htm file under my application and tried openning it via IIS and it gave me the below error:

Internet Explorer cannot display the webpage

I'd guess there is something wrong with my IIS?!

4
  • The server Event Viewer will have the exception details in the Application log. Commented Feb 10, 2012 at 16:02
  • 1
    Is it supposed to link to /Views/Home/Index? I think the link should be localhost:85/Application/Home Commented Feb 10, 2012 at 16:21
  • @jao, you're right; updated. same result though. Commented Feb 10, 2012 at 16:36
  • @jrummell, the Event Viewer seems to log nothing about the IIS error. Commented Feb 13, 2012 at 10:30

3 Answers 3

2

Don't put it in a subdirectory of C:\inetpub\wwwroot

The problem is that by default, there's a web.config file in C:\inetpub\wwwroot, which IIS will read from, even though your site is not directly in that directory.

You can create another folder in C:\inetpub and put your site into there.

Also, you can have multiple sites running with the same port, but using different host headers.

Sign up to request clarification or add additional context in comments.

3 Comments

I moved it out, same result. I also put an html file there and it showd "Internet Explorer cannot display the webpage"!
Try changing the identity that the application pool is using, and ensure that it has permissions to access the directory of your website, as well as C:\Windows\Temp
You can put your website in a sub folder of C:\inetpub\wwwroot, but you have to be careful because the web.config file there will affect sub folders. You can, however, override them with application specific web.config files.
0

Out of curiosity, where did port 85 come from? Try taking that out (the default port for HTTP is 80). Also, look in the application error log for additional info on the error. There is also a section of web.config that you can set so that detailed error messages will be displayed (which should not be set for production).

<customErrors mode="Off">
</customErrors>

1 Comment

Update, it's just the port used for my Site in IIS. I have added customErrors off; no difference.
0

I added some more features/services to my IIS using the Server Manager and registered asp.net with it using aspnet_regiis -ir and this error is resolved.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.