Cannot run any web application in VS 2010/2012 getting "Unable to start program" - asp.net

Since this morning I cannot run any web application in Visual Studio 2010 or 2012, getting the following error:
No break points are being hit in the Global.asax. I thought there's some issue with dll's I'm referencing so I tried creating a clean new web forms and MVC-4 applications using both 2010 & 2012 but still getting the same error

Try going to http://localhost:2980 in your browser without debugging in Visual Studio. It should give you a more accurate error.
Some other things to try
delete your bin and obj folders (Clean your solution)
restart Visual Studio or even your OS
restart IIS
run aspnet_regiis -i
some more things to try
if you installed web express first, http://forums.asp.net/post/5373941.aspx
try running visual studio in repair mode

Seems like there's a problem with Internet Explorer(I'm using version 10) If i run the site in Chrome or Firefox it works fine

Related

Error when trying to open my asp.net 4.5 MVC web application using VS 2012. Asp.net has not been registered on the server

I have a Windows Server 2012 R2 & Visual Studio Professional 2012. now i use to develop an asp.net 4.5 mvc 4 web application without any problem. but now when i try to open the project i will get this error:-
if i click OK then this error:-
if i click OK the visual studio will stop working
so can anyone adivce what is going on ??
and here is how the Turn windows features on/off looks like:-
Now i did this modification, as i read on a post in the internet that deleting the cache might help. so i removed this folder:-
%LocalAppData%\Microsoft\VisualStudio\11.0\ComponentModelCache
then i tried to open the Visual Studio, and i got the same 2 errors, but the visual studio did not stop working, and i was able to modify the code i rebuild the project and run it.. so not sure what is going on ?
aspnet_regiis -i
Using the ASP.NET IIS Registration tool, you can perform tasks such as the following:
Register or remove the .NET Framework ASP.NET installation with IIS.
Create new ASP.NET application pools.
Display the status of all installed versions of ASP.NET.
More here
Edit 1:-
dism /online /enable-feature /featurename:IIS-ASPNET45 /all
Try running this command
Edit 2:-
Try downloading and installing this update
This is a related tweet
If you get KB3002339 hanging kill the VSUpdate process in task manager. Windows Update will finish. Bing/Google KB3002339 install manually.
https://twitter.com/blowdart/status/542542342075346945
In order to resolve this error you have to install related version of .Net framework in your system.
First install IIS if not installed.
Then run following command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319> aspnet_regiis -i
OR (Depens on your OS)
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_regiis -i
And in IIS your site should run on pool with version like : .Net FrameWork v4.0.xxxxxx
Open your solution as an Administrator
Maybe this answer comes too late, but I tried the solution from #Sameer referring to this question stackoverflow.com/questions/13749138/asp-net-4-5-has-not-been-registered-on-the-web-server#13749209
aspnet_regiis -i
didn't work for me aswell, but this update fixed the problem for VS 2012
For Visual Studio 2012 you actually need to download an update to fix it from here: support.microsoft.com/en-us/kb/3002339 – Sameer Nov 16 '15 at 21:17
See if the computer has self updated to .NET 4.6 (due to Windows Update task).
In some situations, the installation of .NET 4.6 may impact on Visual Studio 2012.
In my case I had to upgrade my project to NET 4.6 to solve the problem.
In relation to IIS itself, I guess you may be forgotten some feature - as HTTP which I guess is necessary, even if you won't utilize it directly. Check all features and toogle OFF just those really optional (like FTP).
This reminds me of similar issues I have seen in the past and I strongly suspect it's an installation order related thing which ultimately boils down to the aspnet_regiis command which has been mentioned already (here's some more information on this topic: https://rockyprogress.wordpress.com/2011/09/06/iis-7-5-and-net-framework-4-installation-order-does-matter/).
You would generally want to install IIS first and then .NET afterwards. So I suggest you get rid of the .NET 4.5 installation again by using the "Turn Windows Features On/Off" screen and then later simply add it back in.
Please try below point
1) open Visual studio run as administration
2) Please host your site in IIS (Not on port like localhost:65389...)
3) Make sure about application pool (with framework 4.0)
4) run C:\Windows\Microsoft.NET\Framework\v4.0.30319> aspnet_regiis -i command

IIS Express giving a compilation error, denies access to files

I am running Visual Studio 2015 on Windows 7. I have a solution with 2 startup projects, both running on IIS Express, and the .NET version is 4.5.2.
Whenever I start the solution for the first time, everything works as expected. However, when I stop the application, make some changes to the source code, and restart, I get this Compilation Error -532462766 screen on startup :
The detailed compiler output is filled with lines like this:
/R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\268da2e1\665f7c6d\assembly\dl3\a9f1f009\c9360fff_0864d101\ServiceStack.Common.dll"
Going back to Visual Studio, and selecting "Clean Solution" gives me these unable to delete file messages (username and projectname removed).
The only way to get things working again, is to right-click IIS Express in the notification area, exit the process, then clean the solution in VS2015, and rebuild. Everything works again then, until the next time I need to change something in the source code (which happens quite a lot, being a software developer and all).
It seems IIS Express or Visual Studio, or my Windows user account is not allowed to delete files in IIS Express. I have tried running VS2015 and IIS Express in administrator mode, but no luck. What else can I try?

Debugger For Visual Studio is not Working

I am facing a very serious issue with visual studio debugger. My asp.net application is hosted on local IIS server. Yesterday i was debugging my code suddenly it stopped working. I verified w3wp process. It was same as IIS process. Then i tried to download symbols but i am not sure either they are all that i need. I tried attaching debugger on visual studio 10 and visual studio 12. Neither of them is working in this case. I tried to attach debugger of JavaScript but it is also not working.
Please Help.
Are you building full debugging symbols? If not then the debugger has no information to relate the source code to the in memory activity under the debugger. This is set in the project properties per configuration.
Also ensure the symbols are in the bin folder.
You can validate that VS is loading the right symbols with the Debug | Modules window.
I cleared temporary cache of .NET Framework. then i again deployed my application on IIS with different name and magically everything started working.

"An operation is not legal in the current state" error when trying to launch ASP.NET project in VS2013?

I have an ASP.NET web site created with WebMatrix 3. I do have the option in VS2013 checked to use the 64-bit version of IIS Express since I am running on 64-bit Windows 8.1. When I try to launch the project I get the error "An operation is not legal in the current state". Does anybody know how to fix this?
I got this same error "An operation is not legal in the current state" when running a project on Google Chrome, Stopping the project then closing all chrome instances fixed the problem.
I think it's related to visual studio not being able to attach to chrome instance for debugging.
Closing Chrome and restarting IIS (e.g. in IIS Manager) should solve the issue. It helped in my case.
Just had the same issue on VS (Visual Studio) 2017 this morning.
The steps that will resolve this are:
Stop project that runs in VS
Clean all IIS instances that VS temporarily created
Compile project and start that service again

Failed to Map Path '/doc'. server.map path

If I run the site using the internal Visual Studio web server, I get the failed to map path error.
It seems to be a security problem.
I assume you use Vistual Studio 2008 and Vista or Windows Seven.
Launch Visual Studio with the administrator right, and the problem should disappear.

Resources