Related
When I run my Web API application I get the following window:
It just stays like that indefinantly, until I hit cancel.
When I do hit cancel, this error message is shown:
I have tried rebooting, and running iisreset /restart but it does not fix it.
Any ideas what I can do to get my debugger working again?
NOTE: My Web API 2 project's Servers setting is set to Local IIS. My service is hosted by IIS and when I am not debugging, it works fine.
A possible fix:
Check the "Enable Just My Code" in Tools->Options->Debug
I just did a reset for all the settings for VS and it worked again.
Tools => Import and Export Settings => Reset All Settings
good luck!
I had this issue for Visual Studio 2017 and like with the previous post I had Debugging option "Enable .NET Framework source stepping" ticked. Un-ticking fixed the issue.
So as I commented before I had this same issue, but I now figured out the cause and have a solution.
I just got a new machine last week (this issue was actually one of the reasons why) and after a while I had the same issues, not being able to debug my projects. Luckily because I was installing all the updates one by one I was able to pin-point when it started happening.
It seems the latest update for the "Microsoft ASP.NET and Web Tools" extension breaks something.
Sadly, uninstalling or reverting the Web Tools extension is not easy: Remove this extension by going to the Windows control panel and modifying your Visual Studio installation. I had to remove Visual Studio completely and reinstall it (repair didn't do the trick).
You can update and install all your extensions as you wish, just make sure that you don't update the Web Tools extension
I tested this on my old machine and it did the trick there as well.
I've also created an Issue on GitHub as I won't be updating the extension until this is fixed, if anybody has additional information please add it to the Issue.
In Visual Studio 2015, go to Tools -> Options -> Debugging and deselect "Enable .NET Framework source stepping". This may relate to an issue with loading symbols, so if you want to keep the ability to debug .NET Framework source, then it may help to search the web for how to clear the symbol cache, or preload it, or set your symbol server, and so on.
In Visual Studio 2017, I just restarted my machine and ran the solution, no other windows opened not even a browser, although visual studio took a long time to open (30+ projects in a solution) the problem did not reoccur.
I had the same issue in VS 2017 and un-checking 'Native code' did the trick. Not sure why it was checked.
In my case I set Debugging ->Symbols -> To "Load Only Specified Modules" to include the symbols for, in my case a devops symbols feed for some internal NuGet packages
Options>Debugging>Symbols>Load Only Specified Modules
By checking the option "Always load symbols where located next to modules" the setting won't mess with the regular/classic debugging in VS for your own code
This way the Symbols are still loading where needed and Visual Studio is not trying to load debugging information for all the IIS .net dlls that were loaded by w3wp
Alternatively it can also be configured to not load symbols for microsoft.*.dll and it will also work.
Didn't see this in the current answers, so thought I'd give my 2 cents in 2022:
What worked for me:
Make sure to check that your IIS application pool hasn't been stopped (and restart it if it is), and then if that's not the case, restart your IIS server.
If you don't where those settings are, open our Internet Information Services (IIS) Manager, Application Pools are in the left-hand column, and restart/start/stop your server is in the right column.
I am trying to run any program on visual studio 2013 update 3 and I get the following alert box:
Process with an Id of #### is not running.
Every time there is different ID number showing.
and in the error windows, I get this error message:
The program '[3148] iisexpress.exe' has exited with code -1073741816 (0xc0000008) 'An invalid handle was specified'.
Sometimes it runs and in the browser I get the following message:
The webpage is not available.
Why is this occurring and how can I resolve it?
The following steps fix the problem for me:
Close Visual Studio
Navigate to the folder where your solution files are stored and delete the hidden .vs folder.
Restart Visual Studio
Hit F5 and IIS Express should load as normal, allowing you to debug.
Note: Based on my experience and others in the comments, this problem seems to be caused by moving a project between workstations, environments, or versions of Visual Studio. There must be some environment specific information contained in the .vs folder.
Open Visual Studio as an administrator
Right-click your project and click on 'Unload Project'
Again, right-click your project and click on 'Edit PROJECT_NAME.csproj'
Find the code below and delete it:
<DevelopmentServerPort>63366</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:63366/</IISUrl>
Save and close the file .csproj
Right-click your project and reload it
First Error
For the first error:
Process with an ID #### is not running.
The following steps worked for me:
Close all instances of Visual Studio.
Rename the IISExpress folder (in my PC is in C:\Users\jmelosegui\Documents).
Add the _CSRUN_DISABLE_WORKAROUNDS Environment System variable with the value of 1.
Start Visual Studio in administrator mode. (In Windows, right click the executable file and select Run as administrator).
Second Error
The second error:
The webpage is not available
What caused this error:
I deleted IIS Express Development Certificate while playing with the SSL.
The following steps worked for me:
Go to Control Panel.
Select Add/Remove Programs.
Locate IIS 8.0 Express.
Right click on it then click Repair.
Your certificate should be back!
With respect to the first error:
Process with an ID #### is not running
This situation will sometimes occur when IIS Express fails to bind to a port. A likely reason for that is that some other process has already bound to that port. Visual Studio will launch the IISExpress.exe process (which will fail to bind to the port and exit again) and then attach to the now-terminated process, resulting in the above error.
To check, note the port number in your project settings (e.g. 12116) and then try:
netstat -ano | find "12116"
If another process has the port open, this will give its PID. You can then choose to kill the offending process or reallocate your own port number.
If you are using a 64-bit machine
Then the problem maybe due to Visual Studio use of 32-bit IIS-Express.
Solution: In Visual Studio, go to Tools menu > Options > Projects and Solutions > Web Projects > Enable the option "Use the 64 bit version of IIS Express" and click ok
I had the same problem. Just restarting Visual Studio worked for me.
My fix was simple, I was missing prerequisites. I needed to install .NET Core SDK
Kilanny's answer is correct. Most machines in 2015 are 64bit, so there's a lot of chances that you just need to enable the 64bit option under the Tools main navigation link menu. No need to configure other files or hard code ports. Besides, port assignment should be dynamic. This fix applies to 2013 With Update 3 and Visual Studio 2015 Community Edition.
Check the images below for a mini tutorial:
(I'm just improving Kilanny's answer)
It looks like there are many solutions that work and some that don't...
My issue kept surfacing after a few test iterations.
Yes restarting the PC and/or VS would resolve the issue...but temporarily.
My solution was to undo a security change I had enabled a couple days
earlier to Controlled folder access under Ransomware protection.
I undid this change by:
(right click Start)
Setting->Update & Security->Windows Security->Virus & threat protection-> Virus & threat protection settings->Manage settings
Under Controlled folder access
Click->Manage Controlled folder access
(this is also the Ransomware protection screen)
Turn Controlled folder access off.
This was 100% the issue for me as I was able to run my test without restarting VS.
Another reason this can happen is for a .NET Core Web app if you upgrade the Microsoft.AspNetCore.Components.* NuGet package to a new version but don't install the new SDK,
In my case it was upgrading Microsoft.AspNetCore.Components.WebAssembly from 6.0.0 to 6.0.1 and didn't install .NET 6.0.1 SDK
go to Properties of the start up project, increment port number of the Project Url is probably the quickest way to get around this problem which I didn't read anyone mentioned yet.
And you don't need to restart VS as it can be a pain sometimes if you needed a few other instances needed to be running.
My solution to this on a new machine and fresh install of VS 2022 was to install the 3.1 framework. So check to make sure whatever framework the project is expecting is installed on your local machine.
I had a similar problem with Chrome. It appears that VS can't attach to the Chrome process for some reason.
Solution:
Close Chrome
With Chrome closed, start the web project and allow VS to open Chrome.
For me, none of the other solutions worked.
The things I tried:
Updating and patching everything associated with Visual Studio
Reinstalling Visual Studio
Reinstalling IIS Express
Several reboots
Adding the _WORKAROUND thing to the PATH
Renaming the IIS folder under documents to regenerate the IIS config
Manually editing the csproj file and removing the whole IIS settings section
Changing the IIS executable usage to 64bit in VS settings
Changing the port of IIS in the projects settings
After checking if the problem was persistent over different projects, it turned out that the problem only occurred in one specific projects. I figured that I had to delete all the user specific files in the solutions folder (such as bin, obj, *.suo, ...)
I just deleted the whole solution folder and reverted the files in git.
TLDR:
Try deleting user specific files/folders like bin, obj, *.suo, ...
Reboot your computer before trying any of these!
Some of these may be helpful. Doing the netstat trick
netstat -ano | find
helped me as another application was using my port, but didn't completely solve my problem. IIS Express still kept crashing. It wasn't until I rebooted my win 10 PC (first time in over a week), that my problem completely cleared up.
Head to the following directory
%userprofile%\documents\IISExpress\Config directory
Delete all files within that folder. Restart visual studio and works like a charm.
I had the same problem, and what needed to be done was setup IIS Express properly.
I right clicked on my project Properties => Web (tab) and on Servers:
Project URL was already pre-populated and I clicked the button "Create Virtual Directory".
I had just reinstalled (refreshed) windows and the IIS was not setup b/c it was new.
I came across the same problem and found that somehow the file 'applicationhost.config' (in ..\Documents\IISExpress\config) had a different localhost port number (in the 'sites' section) to the one specified in project\properties\web. Changed them to the same number and the problem went away
Close VS.
Navigate to the folder of the solution and delete the hidden .vs folder.
Restart VS.
Hit F5 and IIS Express should load as normal, allowing you to debug.
If this not working, then:
right click your solution and go to properties
Click left menu Web tag
Click checkbox "Override application root Url"
and run again your project.
For me this was the solution,
Close all running Visual studio instances
Open the solution folder and remove the .vs folder (hidden folder)
Open Run Command
Type iisreset and press Ok, and you may see a command prompt and
wait for it to complete and it will close automatically
Now Open visual studio and run your project, it should run.
So, nothing worked for me and this happened to happen to me when I got a new machine. Apparently it didn't have the older versions of .Net on it. Went into VS Installer and checked the box for .Net 5 Runtime (VS 2022). Working fine now on all .Net 5 Projects.
TL;DR: if you do have the right .NET Core (or .NET I guess) runtime installed, install any patch updates or reinstall the latest version if there aren't any.
Detail:
Similar to a couple of other answers where they just didn't have the right .NET core installed. I was trying to run a .NET Core 3.1 web app which had worked fine previously for months, and this suddenly started happening.
I did have 3.1 (runtimes 3.1.21 and 3.1.22) installed. However a new one (3.1.23) had been released 12 days earlier, and installing that fixed the problem.
I have no idea if this was because it's aware that there's a new patch and I didn't have it so it wouldn't run, or if there was just something wrong with my 3.1.22 installation. Worth trying installing latest patch, or reinstalling existing installations.
I encountered this while trying to run a project I'd run many times on a machine I'd used for the project many times. Cleaning up my IIS Express directory and my .vs directory didn't work, nor did setting environment variables. I even tried re-cloning my repository to a different folder, but no success.
By trying to run via command line, I found a more useful message:
dotnet run --project [startup project path]
I saw that the project was trying to run using .NET 6.0.5, but I only had .NET 6.0.4 installed. Installing the latest .NET 6.0.5 from the Microsoft website worked.
I also had the same problem, doing the above didn't work for me. What my error turned out to be was twofold.
I had Opera as my default browser and it couldn't attach to that.
I had multiple startup projects so it wouldn't let me switch to IE until I change the default startup project back to just the MVC shell.
I set that project specifically as the startup, then I switched it back to launching IE and it started debugging again.
What I did to make this go away:
Open C:\Users\gr_mext1\Documents\IISExpress\config\applicationhost.config and remove all <site> entries in <sites> do not remove <siteDefaults>!
In your project, go to Properties, Web and click "Create Virtual Directory".
Close and re-open visual studio, load your project and run
Fixed!
None of the listed solutions worked for me. Problem was some sort of conflicting state in local applicationhost.config file. Fix is easy, just delete one in your solution. For VS2015 it should be located in <path_to_your_solution>\Solution\.vs\config\. When you launch Debug, VS will recreate that file based on settings in your project file.
Deleting the hidden .vs folder didn't work for me since the port specified in my app was being used by another app. Doing the following worked for me:
Went to properties and then click the web tab.
Changed the port number in the Start Url and the Project URL.
Clicked Create Virtual Directory.
Save and Press F5.
cmd - regedit-HKEY_LOCAL_MACHINE-SYSTEM-CurrentControlSet-Services-HTTP-START=3
Computer restarted.
worked for me!
Tried most of the things here to no avail, but finally found a fix for my machine, so thought I'd share it:
Following previous advice in another question, I had used netsh to add :: to iplisten. It turns out undoing that was my solution, by simply replacing add in their advice:
netsh http delete iplisten ipaddress=::
You can also do this manually by deleting HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\ListenOnlyList from the registry and restarting the service/your PC.
I update my Visual Studio to 2019 version and has this problem, I tried all solution from this question but it doesn't help to start my ASP.NET MVC 5 project with IIS Express. After I remove IIS Express (using Control Panel), download last version from www.microsoft.com and install it. After this everything works fine.
After some weeks i got update for Visual Studio and I got this problem again. I remove IIS Express and reinstall and it works fine now.
p.s. repair didn't help me, only uninstall and install.
PROBLEM
If you start using "Microsoft Internet Information Services Express (IIS)" from "Microsoft Visual Studio (VS)" you may get when you run Build this error message
Unable to connect to the configured development Web server.
Failed to register URL "http://{ip_addr}:{port}/" for site "{project_name}" application "/". Error description: Access is denied. (0x80070005)
What kind of rights is it?
SOLUTION
This means that you are missing the right for using it. Create it with Netsh Commands for Hypertext Transfer Protocol > add urlacl.
Open "Command Line Interface (CLI)" called "Command shell" with Win+R write "cmd"
Open CLI windows like administrator with mouse context menu on opened windows or icon "Run as administrator"
Insert command to register url
netsh http add urlacl url=http://{ip_addr}:{port}/ user=everyone
Note
For remove you can use: netsh http delete urlacl url=http://{ip_addr}:{port}/
If not work restart Microsoft Windows (WIN) and then open project and build again.
Sometimes these symptoms may be the same like "Unable to launch the IIS Express Web server”.
Delete autogenerated config files on the project folder.
Close Visual Studio projects.
Delete .vs folder on project folder that includes applicationhost.config file.
Visual Studio will generate a new config for this project.
Opening Visual Studio as administrator will fix the problem.
I solved the error by changing the port for the project.
I did the following steps:
Right click on the project.
Go to properties.
Go to Server tab.
On tab section, change the project URL for other port, like 8080 or 3000.
Good luck!
We solved this problem with deleting .vs folder on project folder and deleting temporary ASP.NET files.
1. Close the Visual Studio.
2. Delete .vs folder on project folder that includes applicationhost.config file.
3. Delete temporary ASP.NET Files located: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root
I am using visual studio 2015.
Deleting .vs folder in the project folder helped me to fix this. You must close the visual studio first.
Solution 1
If you use a newer version of Visual Studio, you may not have this problem. I'm currently using Visual Studio 2015 and it works great.
Solution 2
You can solve this problem by changing the project's port number.
Because the reason is a port number conflict with some other application.
I had the same issue and fixed by doing that (by changing the port number).
I had solved this here : Changing project port number in Visual Studio 2013
If you use a different version of Visual Studio; you may also change the port number by project's Properties Window in Solution Explorer.
Worked for me in VS2003 and VS2017 on Windows 8
Run the command in CMD with admin rights
netsh http add iplisten ipaddress=::
Then go to regedit path [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters] and check if the value has been added.
For more details check https://www.c-sharpcorner.com/blogs/iis-express-failed-to-register-url-access-is-denied
For me I tried a few of the above - run as administrator, check firewall.
For me it was the IIS Express configuration. A little bit of a "just get it working" fix without much investigation, but deleting the folder IIS Express is located under
C:\Users\UserName\Documents\iisexpress
Not sure what caused the issue for my VS2013 - but I am constantly flipping between VS2013 sites in IIS and IIS Express.
NOTE: When I forget to run VS2013 as Administrator, my Local IIS project gets inserted in the IIS Express applicationhost.config file, which fails to open the web project. Which is really frustrating.
I solved this just now, in the system tray (bottom right) you can click ion the IIS icon and stop the current site, then it allowed me to run.
I just encountered and resolved this in VS2013 on Windows 7. It is a Web Application Project that doesn't use SSL. But when I examined the Properties Window (F4), SSL was enabled. Setting SSL to false resolved the issue.
However, when verifying before posting this answer, turning it back on did not cause a recurrence of the problem. So it might be that anything that writes to that preferences resolves the problem, rather than the details of what was written.
I solved this by restarting my computer. I'm guessing that this port was being occupied by a process that needed to be killed.
If you've tried many ways and still have this problem, take a look at your firewall settings and make sure it does not block Visual Studio or IIS !!
This worked for me!
I tried almost all the options above, none of them worked for my scenario. Finally I was forced to uninstall IIS Express, re-start the machine, and install the same version again from Microsoft.
Anyway thanks for all the suggestions above.
This happened to me on Windows 7 and VS 2013 while viewing a project on the browser after build. I only had to close the browser "Chrome" then made sure that the port is not in use in my Network Activities using some utility then tried again and worked without any problem.
Additionally to Bruno's answer I ended up registering the same port for localhost. Otherwise VS2015 was giving me Access Denied error on server start.
netsh http add urlacl url=http://localhost:{port}/ user=everyone
May be it's because I have binding for localhost in aplicationhost.config also.
Visual Studio 2015, Windows 10, project source control was managed in TFS Online.
None of this worked form me, issue appeared after a reformat of Windows 10 and subsequent reinstall of VStudio 2015. I mapped projects to the same folder (residual folders and files were still there.)
Deleting the entire old project (specifically the .VS) and then remapping it fixed everything.
Just update Visual Studio, this is the simplest solution that worked for me.
Delete .vs folder on project folder and Delete temporary ASP.NET Files located:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root
And the Open the Visual Studio in Admin mode and run the program
i created a new solution and imported the projects.
I just started working in Visual Studio 2012 in a project group. We are using team foundation server to share our code. I have a couple of problems here I was hoping someone could help me solve them.
I have succesfully connected to our TFS-server and checked out the project, but for some reason when I check my solution explorer it says "0 solutions". I dont know if this is a problem but I feel like it has something to do with my other problems.
I can't, for some reason, press the play button to start debug, also in the menu the debug option is greyed out, 5 obv doesent work either. And in the "project" tab I dont have the option to set my project as startup project wich would make it so that I can debug it.
Check your Source Control Explorer. There you can navigate the code in TFS. Make sure there are files checked in to this location. If not, you will first have to add your project to TFS.
If there are files in TFS, map the files to a location on your harddrive. Then open the solution file by double clicking it in your Solution Explorer.
The MSDN has a nice walktrough: Set Up Team Foundation Server for Version Control
It turns out the local path has to be in the visual studidio\projects folder... re-mapped it and works as intended. No need to answer this anymore, thanks for your suggestions though :)
Today I installed VS2010 SP1 Beta, and IIS 7 Express, as I currently have IIS5 on my local development machine and thought I'd try IIS Express out.
I have gone into the properties window for my Web Application, checked the 'Use IIS Express' checkbox, created the Virtual Directory when it has prompted me, but then get the message "Unable to launch the IIS Express Web Server. Port x is in use".
I have tried changing the port number from the default value that was in there, to numerous other port numbers, but whatever value is there, I am always getting this message, and am therefore unable to use the IIS Express Web Server.
Does anyone know what the problem might be, and how to get around it?
If you are using ESET NOD32 Anti Virus, you need to change the setting of "Web access protection" => HTTP, HTTPS => Web browsers => red cross the check box of your devnev.exe (This is three state checkboxs, click the check box until red cross appeared)
I have just installed VS 2010 SP1, using the above setting to tell NOD32 to leave 'IIS Express' alone.
Reference: http://weblogs.asp.net/anasghanem/archive/2009/02/01/nod32-antivirus-is-blocking-visual-studio-built-in-development-server.aspx
What version OS are you using?
Are you able to start IIS Express from command line? Could you try the following and post the error message you are seeing.
Remove IISExpress directory located under 'My documents' folder
Go to IIS Express installation folder '%programfiles%\IIS Express' (on 64-bit machine '%programfiles(x86)\IIS Express') and try to start iisexpress.exe from command line (without passing any arguments)
I had a similar problem. It seems that if IIS Express is already running a particular site and then you try to run a project that uses that site through Visual Studio it isn't able to attach the debugger. The solution was to close any running instances of IIS Express and WebMatrix and then try running the site through Visual Studio (F5).
I recommend installing WebMatrix as it's the simplest way of managing the sites and port numbers that you are using.
I have the same problem in the visual studio 2012.
I am creating a sharepoint app for the SharePoint 2013 and it happened after some days means it was working before then I got the error:
" Unable to Launch IIS web Server " "port 62308 in use.
To fix this I just went to the settings of the web project by right clicking on the project node in in right panel under the project solution tab. Change the port number and configure the virtual directory and it worked for me.
Hope it work for anyone else in case he/she has any problem.
1- Close Visual Studio.
2- Delete IIS Express folder in Documents or edit applicationhost.config:
<bindings>
<binding protocol="http" bindingInformation=":8080:localhost" />
</bindings>
3- Delete solution file.
4- Start Visual Studio and use open website.
5- Choose your website folder.
If any body still facing the same issue ... even after trying all the above steps
try the following simple steps...
1) close all other applications
2) Download TcpView application from
http://technet.microsoft.com/en-gb/sysinternals/bb897437.aspx
3) run the application, check the localport column and see who is using that specific port
and end that task
That will solve your problem ... :)
go to solution explorer, right click on the present Application then go to properties, now click on web scroll the mouse and change the port no. from project localhost:1257
NOW RUN IT...