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

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


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:

  1. Stop project that runs in VS
  2. Clean all IIS instances that VS temporarily created
  3. Compile project and start that service again