Search code examples
c#asp.netiisvisual-studio-2013

Why ASP.NET Project Gives HTTP Error 500 When Launched Through IIS 7


I'm writing an ASP.NET Web Forms project in Visual Studio 2013, but am having trouble moving it to my computer's IIS 7. Although the project launches successfully from Visual Studio and works properly, launching the version I put on IIS gives an HTTP 500 error: "localhost is currently unable to handle this request."

Here is my process:

  1. Use the File System method of Visual Studio's Publish tool to publish the project to a folder on my computer.
  2. Access IIS' Default Web Site, and set the Physical Path to the folder I published the application to.

If the project works from Visual Studio, why wouldn't it work in IIS?


Solution

  • The problem was I was submitting a Web Form Application instead of a regular Web Site. The former has additional files in it that makes it not work properly in IIS (at least, I've never been able to make it work).

    Thankfully, making a blank Web Site in Visual Studio and copying the web pages over from the Web Forms application was a simple matter, and I got it working easily.