14

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 ?

user4612290
  • 311
  • 4
  • 7
  • 18

9 Answers9

5

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!

Joe Raio
  • 1,795
  • 1
  • 12
  • 17
  • 1
    This was driving me nuts. After upgrading a project's libraries after several years of no updates. Everything worked but then I noticed the ASMX web services were returning 404's. I inspected everything in the Web.config and anything ASMX related. Ended up restarting IIS on my local machine and it worked. – Seany84 Mar 31 '17 at 16:58
4

I had this problem.

another solution can be changing the Application Pool settings:

go to the application pool related to your application. Click advanced settings. Change the "Enable 32-Bit Application"

Bob
  • 22,810
  • 38
  • 143
  • 225
0

I just ran into this response, and turns out it was caused by a StackOverflowException inside the action that supposedly could not be found. I was able to see this by attaching to IIS using the visual studio debugger. Go figure. I was doing a POST though.

itslittlejohn
  • 1,808
  • 3
  • 20
  • 33
0

As Seany84 explained in their comment above, if you have migrated from to 2.0 to 4.0, most probably your webconfig contains some tags that are incompatible with new version. In my case there was an 'applicationSettings' section that caused the problem. After removing this tag from webconfig my webservis started to run properly.

0

When you get

The resource cannot be found.

error on the server but it works fine locally - it could be caused by your server running out of disk space. Navigate to the server and check directory structure to see if the file exists. Also check your log messages for more details.

0

Folder Permissions on wwwroot.

Add IUSR with (Read & execute , Read)

Add (machine name)\ IIS_IUSRS (Read & execute , Read)

If IIS doesn't have permissions to access the file, you will be blocked

0

I had this problem and i fix it following way,
Make sure you don't have any errors in web config, For finding error goto IIS > your application >Manage Application > browse A page will open in internet explorer, You will find error here, fix it and restart application it will work

Ninja
  • 338
  • 4
  • 12
0

I was able to resolve my issue by leaving the IIS Site Bindings 'Host Name' blank.

enter image description here

Colin
  • 1,758
  • 1
  • 19
  • 24
0

I have tried all the answers all of them are useful. But in my case after changing these settings Restarting my machine (not just the IIS). worked for me

ansar
  • 128
  • 13