Error : "Unable to start debugging on the web server..." ASP.NET 4.0 - asp.net

I am getting an error when I want to create a web site on IIS server. I am using Windows 7 and Visual Studio 2010.
Do I have to register or configure asp.net 4.0 for the IIS ?

There aren't many details here, but I was getting that same error while trying to Start Debugging on a web application project in Visual Studio 2010 that I'd just changed from 3.5 to 4.0.
This solved the problem for me from the command line:
cd %windir%\Microsoft.NET\Framework\v4.0.30319
aspnet_regiis.exe -i
Just make sure to go into IIS Manager afterwards and double-check your application pools and such, since it's likely that this will reset some of your configuration.

This did the trick for me:
In IIS > under .NET compilation
Note: Default Website is selected only for screenshot purposes.
Changing the Debug option to True

This error can appear if the password for the account used by the application pool changes. If you start getting this error after changing your network password you may need to update it for the application pool used by your local web sites as well.

In Visual Studio 2010 this usually means there is a problem with Web.Config file that cannot be displayed in Debug mode. So, simply start the app using Ctrl F5 to run in normal mode will tell you which line in Web.Config is faulty.

Check that the path of your site in IIS points to the path of your web project in VS.
I ran across this before and it was an issue of mismatched paths. If you've configured Visual Studio to use IIS and later on changed paths, IIS isn't updated automatically. You need to manually go into IIS and update the path.

Make sure your site is setup to debug (debug="true") under web.config file
<compilation targetFramework="4.0" debug="true">

For me this was related to this solution: http://www.codeproject.com/Questions/83338/Does-not-have-write-access-to
cd %windir%\Microsoft.NET\Framework64\v4.0.30319
aspnet_regiis -i
aspnet_regiis -ga "IIS APPPOOL\DefaultAppPool"
Note this didnt work after I did it on Framework folder and then worked after I did it on Framework64 folder. I guess do both to be sure.

Tried running vs2010 as administrator?
Also try
1. Open IIS. Click “Default Web Sites”.
Check if “Anonymous Authentication” is enabled.
Enable “Windows Authentication” as well.

I've had this several times - in my case it's always that I've not updated my hosts file so VS is trying to locate an external DNS instead of my local one.

I spent a few hours fighting with this issue. In the end it seems to be that some changes made outside VisualStudio had confused it. I don't know what the issue actually was but things started to work again when I opened a different version from the same solution so that VisualStudio (or IIS) did some magic on the IIS configuration. Then I changed back to the original solution, the configuration was again modified - and now debugging works again.

Another reason would be if you have SSL Certificate installed on IIS. You will have to disable the SSL from IIS manager for the application that you are debugging. Because Visual Studio tries to launch it as http instead of https.

In my case, I was receiving a 0x80004005 error message box in VS2019.
That was caused by HSTS being enabled in the "Advanced properties" on the website.
Screenshot of advance site settings in IIS
Found this post which seems useful if someone wants to do debugging with HSTS being enabled: https://scatteredcode.net/debugging-on-localhost-with-hsts/

I get this same error every time I set my project file as a share.
I resolved it by going into the security tab of the file and re-adding "IIS AppPool\DefaultAppPool"

In my case, i have to change the certificates bindings in IIS>Default Web Site > Binding.
IIS Binding

If you are using Visual Studio, you need to check what server you are trying to run your application on.
Right click on the project
-> Web
-> Servers
-> In the first dropdown choose "IIS Express" (To debug with VS).

Related

IIS7 MVC Routing Not Working

Our company ships an MVC based product (targeting v4.5) which has stopped working on a customer site for what appear to be environmental issues - a build which worked with no problems once upon a time now gives a 403.14 - The Web server is configured to not list the contents of this directory.
.
What I think is happening...
The user accesses http://server/AppName
Because it's an MVC app, the default route (Reports/Index) should be used.
Instead IIS is looking for a default document...
... and, not finding one, it assumes the user wants to list the contents of the directory...
...which is not enabled so it throws a 403.14.
.
What I've tried so far...
Accessing the route directly.. results in 404 error. So I'm pretty
sure IIS doesn't realise it should use routing.
Use aspnet_regiis to register ASP.Net with IIS. This was done from the Framework64 folder since...
OS is 64 bit - Windows Server 2008 (Standard without Hyper-V)
IIS is 64 bit - though Enable 32-Bit Applications is true
Checked AppPool is targeting v4 of the framework - it is.
Changed AppPool mode to Classic - was pretty sure it should be integrated but was worth ruling it out. It is now back to Integrated
Confirmed RunAllManagedModulesForAllRequests is set to true in the web.config.
Checked permission conditions defined in <system.webServer> section of web.config are met - they are.
Created the simplest of MVC applications and deployed it - same problem.
Running the command shell as Administrator unregistered ASP.Net using aspnet_regiis -ua and re-registered using aspnet_regiis -enable -i. We hit a couple of permission problems - and the Temporary ASP.NET Files directory was missing but once they were address we were back to the same error.
Added a simple default.htm - when present, this is served in response to the http://server/AppName request.
I'm clean out of ideas and all google hits suggest some combination of the above - or enabling directory browsing (which I think is just a symptom rather than the root cause).
Also, not sure if it's relevant but the amount of configurable elements available for the application in IIS seems a bit below what I would have expected...
Have you Checked the user the application pool process is running under? I think Your site needs to run with permissions to execute the .net libraries and I've seen this just change for seemingly no reason (probably related to an overzealous update to the system).
You can try with the Enabling directory browsing .
assuming you are under Windows Server 2012 or Windows Server 2012 R2
On the taskbar, click Server Manager.
In Server Manager, click the Manage menu, and then click Add Roles
and Features.
In the Add Roles and Features wizard, click Next. Select the
installation type and click Next. Select the destination server and
click Next.
On the Server Roles page, expand Web Server (IIS), expand Web
Server, expand Common HTTP Features, and then select Directory
Browsing. Click Next.
On the Select features page, click Next. On the Confirm installation
selections page, click Install. On the Results page, click Close.
if you using the Windows PC try this in your command prompt as follows:
go to C:\Program Files\IIS Express
then press Enter:appcmd set config
/section:system.webServer/directoryBrowse /enabled
Maybe this is your case https://forums.iis.net/t/1157304.aspx
SQL Server Reporting Services creates a folder called Reports by
default if you install it on IIS. If you install SQL 2008 then
Reporting Services doesn't need to use IIS and instead will try to
reserve the URL with the HTTP.Sys service.
I believe this is the cause of the conflict you are seeing. What you
could try is changing the URL that Reporting Services uses via the SQL
Server Configuration Wizard.
Also I found that
Report Manager of SQL Server can use reports path http://<server name>/reports
Configure a Native Mode Report Server for Local Administration (SSRS)
I think the problem is IIS features that are not installed yet. I have met this kind of problem frequently in Windows Pro. Make sure to turn on every feature under Internet Information Service -> World Wide Services because by default IIS is configured to use WebForms. So there might be some features that not installed yet to use MVC, especially ISAPI filters. In my case, that was the solution. I hope it helps.
Something similar i encountered using VS 2017 & ASP.NET MVC.
Was working on the project for long with no problems at all but suddenly the routing started misbehaving & stopped working.
So I changed the Port in Project Properties Page & it started working.
I really don't know what is the relation between a port & MVC routing modules. Someone else can enlighten if at all this helps.
I had the same problem and I just created an application pool out of the Default Web Site in IIS and stoped the default web site. With that difference you will not have the application pool's path
I know it's been a long time since this question but i've had the same problema recently. I've tried every single configuration, just like #amcdermott did, but the only action that solve the problem was reinstalling .NET Framework.
My app was built under .NET Framework 4.5.2. The application server had the version 4.6.1 and 4.5.2 installed. So, i uninstalled all framework versions and installed the one that i needed.
Please, make sure that no other applications use superior versions of .NET Framework if you going to try this solution.
Here are some quote I find on Microsoft official site which I think may help:
For site administrators
This problem occurs because the Web site does not have the Directory Browsing feature enabled, and the default document is not configured. To resolve this problem, use one of the following methods:
Method 1: Enable the Directory Browsing feature in IIS (Recommended)
To resolve this problem, follow these steps:
Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.
In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.
In the Features view, double-click Directory Browsing.
In the Actions pane, click Enable.
Method 2: Add a default document
To resolve this problem, follow these steps:
Start IIS Manager. To do this, click Start, click Run, type inetmgr.exe, and then click OK.
In IIS Manager, expand server name, expand Web sites, and then click the website that you want to modify.
In the Features view, double-click Default Document.
In the Actions pane, click Enable.
In the File Name box, type the name of the default document, and then click OK.
Method 3: Enable the Directory Browsing feature in IIS Express
Note This method is for the web developers who experience the issue when they use IIS Express.
To do this, follow these steps:
Open a command prompt, and then go to the IIS Express folder on your computer. For example, go to the following folder in a command prompt:
C:\Program Files\IIS Express
Type the following command, and then press Enter:
appcmd set config /section:directoryBrowse /enabled:true

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

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 ?
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!
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"
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.
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.
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.
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
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
I was able to resolve my issue by leaving the IIS Site Bindings 'Host Name' blank.
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

Configuration Error: <compilation debug="true" targetFramework="4.0"> ASP.NET MVC3

I'm trying to deploy my website on somee.com but keeps getting this error
I've tried googling and it says I have to change my App Pool to ASP.NET 4.0. I've tried that already but with no luck:(
Informations:
-My site was coded in 4.0 Framework
-I'm using .NET Framework v4.0 Integrated
-I have checked needed things already in Windows Features
-Im using ASP.NET MVC3
-I already typed cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319 then aspnet_regiis -ir to cmd
-64 bit OS
This is the steps how I publish my site
First I manually added this things to my Reference then changed the Copy Local to True
Microsoft.Web.Infrastructure
System.Web.Helpers
System.Web.Mvc
System.Web.Razor
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
I Editted this on my Web Config
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="None"/>
</system.web>
</configuration>
I add Deployable Dependencies that created _bin_deployableAssemblies which have this inside
Microsoft.Web.Infrastructure.dll
System.Web.Helpers.dll
System.Web.Mvc.dll
System.Web.Razor.dll
System.Web.WebPages.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.Razor.dll
I then click Publish and have this settings
This is how I Publish is this ok or I have to change something here?
I went to my IIS Manager. I right click on Default Web site Under Sites and choose Add Application with this settings
This resulted to this
I went to C:/inetpub/wwwroot and sees this files
I then compressed it as zip then uploaded it in my account in somee.com then checked my site and now I'm getting the Configuration Error above.
ABOVE IS MY UPDATED QUESTION I REPUBLISHED MY SITE AND INCLUDED STEPS HOW I PUBLISHED IT . I INCLUDED IT SO THAT YOU GUYS COULD SUGGEST IF I'M DOING SOMETHING WRONG ON HOW I'M PUBLISHING MY SITE AND COULD BE THE REASON OF THE ERROR ABOVE. THANKS IN ADVANCE :)
My site works fine in the iis of the localhost of my machine it only gets that error when deployed on the internet.
Btw I'm following the tutorials from these sites How to Deploy an ASP.NET MVC 3 App to Web Hosting with "\bin Deployment" Programming ASP.NET MVC 4 Chapter 19. Deployment Deployment ASP.NET MVC 3 project to IIS and somee
Question: What could be the cause of this issue :( It's my first time to deploy a website on the internet. Hopefully you could help me guys.. If you need more info please tell me.
My IIS Manager
My configuration
or could this be the reason of my issue?
OK THIS PROBLEM WAS SOLVED. I FOUND OUT THERE'S NO PROBLEM ON MY SETTINGS. THE PROBLEM IS ON THE SETTINGS OF THE WEBHOSTING SITE. I CHANGED THE ASP.NET VERSION FROM 2.0 TO 4.0 BUT FORGOT TO CLICK THE UPDATE BUTTON :( I FEEL BAD I HAVEN'T REALIZED THAT. I'M NOW FACING ANOTHER ERROR BUT IT HAS NOTHING TO DO WITH THIS QUESTION. THANKS GUYS FOR TRYING TO HELP ME :)
This typically happens when you have an attribute of targetFramework="4.0" in the web.config but the App Pool is set to run ASP.NET 2.0. The targetFramework attribute is entirely unrecognized by ASP.NET 2.0 - so changing it to 2.0 won't have the desired effect.
Contact Support / Your Administrator and have the AppPool switched to 4.0.
You could also remove the attribute entirely, however if your site was coded with the 4.0 Framework, then I'm sure something else will cause an error as well.
Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive
I was now able to find reason behind the error guys. It's on the webhosting site settings not on my app pool or what so ever. I changed the asp.net version from 2.0 to 4.0 but I forgot to click the update button. I feel so embarrased. :( I've been struggling for days to fix this error and only to found out its on the webhosting site settings. GgrrRR.. As of now I'm facing new error but has nothing to do with this question. Anyway thanks guys for your efforts to help me. :)
Try this, instead of selecting your websete's Application Pool to DefaultAppPool, select ASP.NET v4.0
Select your website in IIS => Basic Settings => Application Pool => Select ASP.NET v4.0
and you will be good to go. Hope it helps :)
Also try aspnet_regiis -u then aspnet_regiis -i on below path
C:\Windows\Microsoft.NET\Framework\v4.0.30319
Now restart the IIS and check
Hope this will help !
You could be using the 32 bit version, so you should prob try at the command line from the Framework (not Framework64) folder.
IE Did you try it from
C:\Windows\Microsoft.NET\Framework\v4.0.30319 rather than the 64 version? If you ref 32 bit libs you can be forced to 32 bit version (some other reasons as well if I recall)
Is your site a child of another site in IIS?
For more details on this (since it applies to various types of apps running on .NET) see Scott's post at:
32-bit and 64-bit confusion around x86 and x64 and the .NET Framework and CLR
Make sure that you are building your web app as "Any CPU". Right click your web project --> Properties --> Build --> and look for the "Platform Target". Choose "Any CPU" or play around with it.
Hope this helps!
Each individual Web App under an IIS Web Site can use a different App Pool.
Verify the App Pool assigned to your app (not just the root site per your pictures) is .NET 4.0 compatible:
Expand Default Web Site
Right click on ProjectPALS, choose 'Manage Application' then 'Advanced...'
Observe the 'Application Pool' your app is running as under the site
Change to another App Pool if neccessary
How are you running the application? Are you just hitting the website or are you building and running from within Visual Studio? If you are building and running you may want to tell it to use the local IIS web server. This would make sure it is using the App Pool you have set up to run with v4.0/integrated.
I am guessing that it is using the Visual Studio Development Server when running. This server is probably trying to run with the 2.0 framework. This then causes your error to be thrown.
Edit: To note, I normally just build my website application and then I attach to process w3wp when I want to debug. I do not use the publishing tool. Of course this means my local working directory is within the web root.
Have you tried the aspnet_regiis tool to register .Net 4.0 for IIS? You can check more at msdn
My problem was solved that way:
Your username is probably restricted, You must grant full access to the user.
Right Click on Project and select Properties
Click on Tab Security
Click Edit button
Found Current User and Permission for User Allow Full Control
If your application is 32 bit, and you want to deploy in a 64 bit machine, You need to set 'Enable 32 Bit Applications' property to 'True' in the application pool - advanced settings.

Unable to access the IIS metabase

An ASP.NET web project loads with up the solution, but I get this error
The Web Application Project is configured to use IIS. Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine.
How can this be solved?
This may have nothing to do with registering ASP/IIS. The reason is exactly what the error message says: Visual Studio devenv.exe is not running with sufficient privileges to access the IIS process, and it needs to do this if your solution contains a web project whose Web settings say to use IIS rather than the VS dev server.
There are two solutions to your problem:
Run VS as an Administrator and reopen the solution/project.
Edit the web application's project file with a text editor and change this line
from True to False:
<UseIIS>True</UseIIS>
That will stop it using IIS and demanding higher privileges.
The reason VS demands Admin privileges is, I believe, because it will try and create the IIS web site for you on demand if it doesn't exist.
An answer that worked for me can be found here:
https://stackoverflow.com/a/17460774/3005965
Basically, go to %systemroot%/inetsrv/config. When prompt appears saying you need admin privileges, click Continue.
This should clear up your issue.
Just try to access Visual studio as Admin right click and choose run as administrator.
may fixes this problem.
and take a look at this link for instructions on creating a shortcut.
I ran into this problem when I had copied a project to a new project. I opened the project file (.csproj) and removed the value from the IISUrl element:
from: <IISUrl>http://localhost:21222</IISUrl>
to: <IISUrl></IISUrl>
Have you registered the .NET framework with IIS? You need to run the aspnet_regiis.exe utility found at %WindowsDir%\Microsoft.NET\Framework\vx.y.zzzz\. Run it as administrator as follows:
aspnet_regiis.exe -i
-i : Installs the version of ASP.NET that is associated with Aspnet_regiis.exe and updates the script maps at the IIS metabase root and below. Only the script maps for applications that use an earlier version of ASP.NET are updated. Applications that use a later version are not affected.
Find out more about the utitlity here.
This error also occurs if you modified your Machine.config and added some "invalid lines":
For example, I added some appSettings, to the configuration section (which IIS didn't like).
Just register your Web-project in your local IIS. All the settings you will find in *.csproj file. That works for me.
first uncheck internet information service from turn windows features on or off.
then uninstall iis from your system and restart it. after restarting it install iis again from https://www.microsoft.com/en-us/download/confirmation.aspx?id=34679 and try to open again.
Step 1: Close Visual Studio
Step 2: Go to Project Folder and find ".vs" folder Note: It may be hidden
Step 3: Delete ".vs" folder
Step 4: Open Project Again

VS2010 error: Unable to start debugging on the web server

I get error message "Unable to start debugging on the web server" in Visual Studio 2010. I clicked the Help button and followed the related suggestions without success.
This happens with a newly created local ASP.Net project when modified to use IIS instead of Cassini (which works for debugging). It prompts to set debug="true" in the web.config and then immediately pops up the error. Nothing shows up in the Event Viewer.
I am able to attach to w3wp to debug. It works but is not as convenient as F5.
I also have a similar problem with VS2008 on the same PC. Debugging used to work for both.
I have re-registered Framework 4 (aspnet_regiis -i). I ran the VS2010 repair (this is the RTM version). I am running on a Windows Server 2008 R2 x64 box.
I do have Resharper V5 installed.
There must be some configuration setting or registry value that survives the repair causing the problem.
I'd appreciate any ideas.
Disable the loopback check
(original microsoft page here)
To set the DisableLoopbackCheck registry key, follow these steps:
Click Start, click Run, type regedit, and then click OK.
In Registry Editor, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
Right-click Lsa, point to New, and then click DWORD Value.
Type DisableLoopbackCheck, and then press ENTER.
Right-click DisableLoopbackCheck, and then click Modify.
In the Value data box, type 1, and then click OK.
Quit Registry Editor, and then restart your computer.
I got a new PC with Windows 7. I installed VS2010 and my development environment and hoped my F5 debug problem would be gone, but it still failed to start the debugger.
This was a good clue since it ruled out the install of software.
I finally traced it down to my HOSTS file. I had an entry for some of my local websites which I can access like "http://testsite.lcl" but the IP I had assigned was my machine's IP instead of using 127.0.0.1 so it looked like a remote server to VS2010. Changing back to 127.0.0.1 resolved the issue.
Thanks for everyone's help on this.
I had the same problem. How did I fixed it.
Go to IIS (in my case IIS 7 / Windows 7).
Select your web site from the list, click on .NET Compilation in ASP.NET section. Select Open Feature. Check if your Debug is set to True. In my case it was False. Once I changed it to True - I have my debug back :)
These steps my differ depending on your version of Windows. I am using 7 with iis 7.
Open IIS Manager, click on Application Pools and find the 2 ASP.NET v4.0 pools (One is called "ASP.NET v4.0" the other "ASP.NET v4.0 Classic". Chances are that first one is stopped. Do not start it yet, we need to investigate a bit more.
For the "ASP.NET v4.0" pool, check the name in the Identity Field. Is it ApplicationPoolIdentity? Remember the name.
Open Computer Management (right click on My Computer and select Manage). Expand Event Viewer, then Windows Logs. Click on Application and wait for the data to load. There should be an error with a source of User Profile Service with a message that starts with "Windows cannot log you on because your profile cannot be loaded. Check that you are connected to the network, and that your network is functioning correctly."
If you do find that, then you have the same problem as I did.
The Solution: Go back to IIS Manager and right click on "ASP.NET v4.0" and select Advanced Settings. Under Process Model, the first field is Identity. Change this from ApplicationPoolIdentity to NetworkService. Click OK.
Now start the pool if it did not restart automalically. Go back to your application and press F5 (start debug) and your application should work.
Please note that I have not figured out why this works, and this may be a security risk, but at least you will be able to do some work while you think about this.
I had this problem in Visual Studio 2012 when running a website I had created in Visual Studio 2010. I tried each of the following, which did not solve the problem, but still may have been required:
Checked that the App Pool was targeted to the same framework as what was specified in the web.config
<compilation defaultLanguage="c#" debug="true" targetFramework="4.0">
Started the 64bit Remote Debugger: \Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe
Set the DisableLoopbackCheck registry key and restarted Windows. MS Instructions here
Browsed the site locally (it came up just fine).
Finally I found the IIS setting that fixed the issue.
Go to IIS (7.5 in my case) and click on the relevant site in the Sites node.
Double click .NET Compilation in the ASP.NET section
Under Behavior, set Debug to True.
Click Apply and run the site in Visual Studio.
You can firstly deploy your web application/site with your iis, then open your visual studio 2010. Then click "File"->open->website->Local IIS Site, then select your website/application. Then you will find that the debug may works. This method works for my case.
I had the same issue on Win7 and VS2010 (without ReSharper) and found that Skype listened on port 80. IIS listens to port 80 by default. This can occur when you set VS to debug an existing web application running in IIS instead of the built in ASP.NET debug web server.
I solved the issue by unchecking "Use ports 80 and 443 as alternatives for incoming connections." in Skype under Tools -> Options -> Connection, followed by a restart of Skype.
What worked for me was to go into IIS at the server level, click on ISAPI and CGI restrictions, I found that aspnet_isapi.dll for asp.net 4.0 was set to Not Allowed. I set it to allowed and debugging worked. The steps are:
Open IIS.
Click on the top level
Select ISAPI and CGI Restrictions under IIS in the Features view
Examine the Descriptions and if ASP.NET v4[current version] has the Not Allowed Restriction, click on the "Allow" link in the Actions section of the dialog.
This change should take care of the problem. Note that I came up with this solution when I tried to run the web app withoug debugging and I came up with the following error:
HTTP Error 404.2 - Not Found
The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.
Another thing to try (this is what worked for me):
In IIS, click Application Pools > (Your Site) > Advanced Settings, and change "Enable 32-Bit Applications" to True.
I don't have a definite answer though these articles may have some helpful info:
Using Windbg to start with w3wp.exe This mentions windbg/cdb debuggers specifically, but this advice should work with Visual Studio talking to cdb (which is attached to w3wp).
Remote debugging with Visual Studio The reason I mention remote debugging at all is that I had to use that a few times in the past to get Visual Studio to attach to w3wp.exe. W3wp.exe runs in a different session, so you can't directly attach a debugger to that.
You have not mentioned what operating system you are using. But this might not be related to operating system. I am taking a guess here. If you are running on Windows 7, try running visual studio under Administrator previlages.
You can also try adding your user ID to the VS debugger users group. You can access user groups by reight clicking on computer name or my computer and selecting Manage. Under that you can find Users & Groups.
In IIS in the Directory Security TAB, if using SSL check "Ignore client certificate" if you are running it in your local PC.
I was getting this after a new install of Windows 7 that did not include IIS by default. After installing IIS, the default app pool was created to run under .NET 2.0. Though I was able to set the default App Pool to .net 4 from .net 2, I still got this error. I had to reinstall .net 4 in IIS to get it to work properly. That is, run C:\Windows\Microsoft.NET{FrameworkFolder}\v{FrameworkNumber}\aspnet_regiis -i
What worked for me was to edit the HOSTS file in the C:\Windows\System32\drivers\etc folder and set the loopback for the website name I'd setup.
For example:
127.0.0.1 http://guyellisrocks.com/
I've had the same issue and in my case it happened because the AppPool identity was set to impersonate an AD user which had its password changed. Therefore the process could not start and the AppPool always stopped when trying to debug from VS.
After updating the password in the AppPool/Advanced Settings/Identity everything started running smoothly.
Check whether the msvsmon.exe (Visual studio Remote Debugging Monitor) file is existing in the below path:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x64
If the file does not persist on the above mentioned path,then you need to get it from any other machine which is having the same version of Visualstudio.
Having tried all of the solutions above, I was still having this issue. Other projects were debugging without issue, so I knew it had to be something to do with this particular application's configuration.
Mine is an MVC app running under IIS 8. The issue was with URL Rewriting.
I had a rule to enforce trailing slashes. All I had to do was disable it (which can be done in IIS directly, or via the web.config below - just set enabled="false")
<rewrite>
<rules>
<rule name="AddTrailingSlashRule1" enabled="false" stopProcessing="true">
<match url="(.*[^/])$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}/" />
</rule>
</rules>
</rewrite>
Unload project, right click "edit abc.csproj" You will see the configuration.
If your project is mapped to use IIS Web Express url.
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>6270</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://matrimonyfree.in/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
verify If you have started the web site in IIS
http://matrimonyfree.in in this case
It may also be because of some special or illegal format in your config file i will suggest you to check for that first .
In my case i was getting an error because of that when i tried to browse my service from IIS it showed me the real error .
I tried every single solution put online to resolve this issue and nothing seems to work consistently.
I eventually solved it in both 2010 and 2012 by tracking it down to the following missing file in the Debug Source Files setting
C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\mfc\
Solution > Properties > Debug Source Files >
Check to ensure all the files are there then remove this entry and everything worked again.
Did you change your bindings on your IIS website? If so, you need to go to your project properties, select the Web tab, and change the Project Url to match your binding. so where it says http:///yourwebsite change it to http:///yourwebsite
This worked for me.
In my case it was the system.webServer > httpErrors > errorMode in the web.config that caused the problem.
If you have errorMode="Custom" try this:
<httpErrors errorMode="DetailedLocalOnly">
See this answer: https://stackoverflow.com/a/15585629/631277 for variations and other ideas concerning URL rewriting
I had same issue with Visual Studio 2013. In my case I had removed the "Default Web Site" from IIS. To resolve the issue I created the default website again, set physical path to C:\inetpub\wwwroot and port to 80 (default port). After restarting the Visual Studio it worked perfectly. Hope it helps someone.
Unable to start debugging on web server. the web server not configured correctly.
How to resolve this problem?
Step-1
open Command Prompt (Run as administrator)
Step-2
C:\Windows\system32>cd..
C:\Windows>cd Microsoft.NET
C:\Windows\Microsoft.NET>cd Framework
C:\Windows\Microsoft.NET\Framework>cd v4.0.30319
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -i
Your solution file in visual studio is broken. It's a known issue when converting from a file-system website to an IIS website, and it has been carried over from 2008 to 2010. Not sure of the location for the bug report on ms's kb site, though.
Remove the website from the solution file (right click the project name, click "remove"). Then right click the solution name, click "add existing web site". When the dialog to add a web site comes up, choose "from IIS" in the left-hand pane. Navigate to your application in IIS, select "use secure sockets layer" if necessary, and click "finish" (or whatever that button is labeled).
this will permanently fix the issue.
Unable to start debugging on web server. the web server not configured correctly.
How To Resolve This Problem?
Step-1
open Command Prompt(Run as administrator)
Step-2
C:\Windows\system32>cd..
C:\Windows>cd Microsoft.NET
C:\Windows\Microsoft.NET>cd Framework
C:\Windows\Microsoft.NET\Framework>cd v4.0.30319
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe -i
Microsoft (R) ASP.NET RegIIS version 4.0.30319.0 Administration
utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation. All rights reserved. Start
installing ASP.NET (4.0.30319.0). .................. Finished
installing ASP.NET (4.0.30319.0).
C:\Windows\Microsoft.NET\Framework\v4.0.30319>
One of the things to check is to make sure if IIS is up and running. Something as simple as that would resolve this issue sometimes.

Resources