Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The resource cannot be found" when opening a page in IIS hosted asp.net web application

Tags:

asp.net

iis

I'm hosting a web application (.Net 4.5) to a remote server using IIS 8.5. The application runs well locally and on the remote IIS, however there is a single page "/Reports/ReportsMain.aspx" that causes the error "The resource cannot be found." I made sure that the page exists. I also made sure that the .Net version for the application pool is set to 4.0.However I noticed the following:

1- When I accessed this page remotely for the first time I got a browser "Login" popping up, although there should be no authentication here at all

2- The error page shows at the bottom "Version Information: Microsoft .NET Framework Version: 2.0, ASP.NET Version: 2.0 " although I've set the application pool to 4.0

What could be the problem ?

like image 556
user4612290 Avatar asked Apr 05 '15 09:04

user4612290


People also ask

What causes Server Error in '/' Application?

The “Server error in '/' application” can occur if there is a typo in the file extension, for example a file or URL that references test. htl instead of test. html. If the file name is correct, then you may need to add the MIME typeto the server.

Is a problem with the resource you are looking for and it Cannot be displayed?

There is a problem with the resource you are looking for, and it cannot be displayed. To resolve this issue, set the Enable 32-bit Applications to "False": Open the Internet Information Services (IIS) Manager. Select Application Pools.


1 Answers

A couple things to try

  • Make sure there is not a duplicate site in IIS that is capturing the request
  • Restarting IIS is never a bad option
  • Make the web.config itself is set to target framework 4.0 and not 2.0

Usually when this happens where it works fine locally but not when deployed it always turns out to be the third item, a web.config configuration mis-match. Hope this helps!

like image 192
Joe Raio Avatar answered Sep 29 '22 02:09

Joe Raio