问题
I have a .NET 3.5 Web application on VS 2008 SP1 running on Vista Ultimate 32 SP1. I created an Application under the Default Web Site. So the url to the app is "http://localhost/mysite". The application folder is pointing to the solution folder and it is outside the iisroot folder. Anonymous and Integrated Auth (Windows) is enabled in IIS7 for this web application "mysite".
I gave full permissions to "Network Service" user to the application folder (which is outside of iisroot).
When I hit F5 to star debugging, I get the "Unable to start debugging on the web server. The web server could not find the requested resource." error.
I fired up TcpView (Sysinternals) to see what app is actually running and keeping an handle on that port and I found out there is no app listening on that port. This is really weird... Any creative ideas?
I can hit the URL "http://localhost/mysite" without a problem. That web application is set up to be the start up project and Default.aspx is the start up page.
There is an .asmx service in the prject as well. The Default.aspx is making use of that asmx service. The AutoCompleteExtender (From the AJAX Control Toolkit) is using this asmx service.
Everything works by the way. The issue is the debugging... I suspect the asmx service is causing this but i don't know. This is driving me nuts...
回答1:
For those encountering this with Visual-Studio 2012 or 2013 and/or Windows 8 or 10 do the following.
You have to add .Net 3.5 (or 4.5) to your Turn Windows Features on or off window. You get to it via:
Control Panel -> Programs -> Turn Windows Features on or off
Click the Asp.Net 3.5
and the Asp.Net 4.5
check box in the IIS > WWW Service > Application Development Features
folder.
回答2:
open IIS7 (run > inetmgr) and go to the Feature view. Open the ISAPI and CGI Restrictions section and check if your .Net version has the correct restriction (for example, if you're working with 4.0 is should be on "Allowed")
回答3:
One more common problem is that site or application path is not started.
回答4:
I had same problem and solved it. You can try following: navigate to the root folder of your web application and find file that has ".csproj.user" extension ad delete it. Close all instances of Visual Studio and start again. Then hit F5. Otherwise hit CTRL+ALT+P and attach to w3wc.exe process. Hope it helps.
回答5:
Just managed to fix this on my dev machine: I've got UrlScan installed and had to add DEBUG to the list of AllowVerbs. Hopefully this might give you something else to go on?
回答6:
Installing Urlscan and changing the urlscan.ini with these changes solved the problem.
In ALLOWEXTENSIONS Section add .aspx and in ALLOWVERBS Section add DEBUG.
Don't forget to restart IIS.
回答7:
I had the same problem with XP sp3 and I have been struggling for days. Adding .aspx and DEBUB to urlscan.ini solved the problem.
Thanks guys.
回答8:
In my case, I had to fix Web Service Extentions
Adminitrative Tools -> Manage my server -> IIS - > Web Service Extensions
ASP.NET 2.0 was prohibited somehow, fixed that and it started working.
Cheers!
回答9:
In my case I had to re-register ASP.NET for IIS. You can do it by running the following command from command prompt
systemroot\Microsoft.NET\Framework\ versionNumber \aspnet_regiis -i
for example: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -i
回答10:
for me, the default website in IIS was stopped, after starting it, I managed to get it working
回答11:
That should not be an issue - what do you have as your startup page? Also, in the 'Start Options' for the web (under properties page), make sure that you have 'Start URL' selected and put in the Url you mentioned above.
The error you are having should not be permission specific, so i would look elsewhere - also check if you can hit the url successfully before debugging (manual put the url in your browser) "http://localhost/mysite".
回答12:
I am using Windows 7 32-bit with VS2005 and IIS 7.5. My web.config had debug="true" by default. I set up IIS physical path to point to the development folder, and followed the above tips. I am not using UrlScan. I am running VS2005 as an admin. I still could not get it working.
What got it working was adding the IIS_IUSRS account w/full access to the development website root folder, and using CTRL+ALT+P (Attach to process) to attach to w3wp.exe.
回答13:
The solution to this issue is pretty simple. If the Web Site is pointing to a different location and if the Virtual Directory is pointing to a different directory, you will receive this error.
I suggest that you point the Web Site to the same directory as the Virtual Directory and the issue will suffice.
回答14:
I've just had this same problem and none of the suggestions worked.
My problem was that my project URL was set to http://localhost/service
. Changing this to my IP address worked.
回答15:
I was using Default Web site on IIS also, but weren't able to launch it by debuging or just by simple browse.
It turned out Default site was stopped!! Started it, and all good.
回答16:
For me, someone had updated the web.config for Request Filtering, in particular they only allowed GET and POST verbs. To use local IIS you need to allow the DEBUG verb too.
<verbs allowUnlisted="false">
<add verb="GET" allowed="true" />
<add verb="POST" allowed="true" />
<add verb="DEBUG" allowed="true"/>
</verbs>
回答17:
Have you tried:
- Turn of UAT
- Add the user the website is running under (and/or yourself) to the Debuggers or Administrators group (temporarily)
- Turn on IIS logging
回答18:
Just to make sure, have you set up Debug=true in your web.config. Generally when you are using VS's inbuilt web server, then it is able to detect that you are trying to debug but debug flag is off and it warns you. But in your case you have setup IIS and VS might not be able to do this check.
Another point is you are running on Vista. In vista even if you are the admin of system, Vista does not treat you as Admin. Your security tokens are created as of normal user. In order to do the debugging IIS hosted website (note: when using inbuilt web server, VS 2008 manages the debugging), run the VS 2008 as administrator. That could solve the issue.
回答19:
I am having the same problem, but am able to debug if I go via the Tools -> Attach to Process menu then select the aspnet_wp process.
回答20:
Go to your web project's properties, then the "web" tab, then make sure that you're using the Visual Studio Development Server and not Local IIS or the custom webserver. I'm on VS2010 with Win7 and another developer was developing using a custom webserver URL and not the VS Dev Server
回答21:
Ensure that the Project Url in the Web tab of the project properties doesn't contain invalid characters. In my case it had a "+" character, which caused this error to appear.
回答22:
This section in my web.config caused the error:
<security>
<requestFiltering>
<hiddenSegments>
<add segment="......" />
<add segment="....." />
........
</hiddenSegments>
</requestFiltering>
</security>
Carefully rewiew it - maybe your debugging file is restricted for direct view in browser there.
回答23:
I tried everything to no avail, but once I got the csproj.user out of there, low and behold, the site loaded. Don't worry about deleting it, as soon as the site load, it will create a new one.
来源:https://stackoverflow.com/questions/287897/the-web-server-could-not-find-the-requested-resource