简体   繁体   中英

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?

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.

我的 web.config 中有一个双重条目,它导致了同样的问题:500 错误,没有其他线索。

I had an entry made in the web.config which caused this error...remove the line fixed this issue. so probably any error in web.config makes the browser to not load the server and hence the issue

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