Process with an ID #### is not running con Visual Studio 2015 - Come risolvere

Visual Studio 2013 e 2015: Unable to start debugging on the web server. Could not start ASP.NET debugging - Come risolvere

Lavorare con Visual Studio sulle versioni più recenti di Windows può portare occasionalmente a qualche problema per via delle nuove impostazioni di sicurezza che caratterizzano il nuovo sistema: queste ultime, che prevedono un accesso limitato alle risorse normalmente disponibili all'account assegnato al software in esecuzione, bloccano l'accesso a molti elementi normalmente necessari agli strumenti di sviluppo: l'accesso in scrittura alla cartella /Program Files/, ai file di configurazione di IIS Express, alla IIS metabase e una serie di altre task che possono portare al malfunzionamento di alcuni strumenti, come ad esempio IIS Express. Alcuni di questi sono già stati affrontati in questa sede, come ad esempio in questo articolo sull'impossibilità di accedere alla IIS Metabase, in questo articolo dedicato al problema delle external request e in questo approfondimento sull'errore 'Impossibile avviare il debug sul server Web'.

In questa occasione parliamo del seguente errore, che può verificarsi nel momento di aprire una soluzione ASP.NET Core o ASP.NET MVC o di lanciare l'applicazione in modalità DEBUG:

Impossibile avviare il debug sul server Web

Process with an ID #### is not running on Visual Studio 2015

In conseguenza di questo errore, nella finestra degli errori di Visual Studio dovrebbe essere possibile reperire altre informazioni, come ad esempio queste:

La prima cosa da fare in questi casi è tentare con un Cleanup completo della soluzione (Clean Solution), seguito da un Rebuild. Qualora questa attività preliminare non sortisse alcun effetto, non scoraggiatevi: fortunatamente esistono diversi workaround che possono risolvere questo tipo di errore. Suggeriamo di provarli uno dopo l'altro, fermandosi soltanto quando si riesce a trovare quello che consente di risolvere il problema.

  1. Cancellare la cartella \Documents\IISExpress utilizzando la GUI di Esplora File oppure il seguente comando console: rmdir /s /q "%userprofile%\Documents\IISExpress"
  2. Cancellare il file applicationhost.config all'interno della cartella \.vs\Config\ che si trova nella directory principale della soluzione VS2015.
  3. Cancellare l'intera cartella \.vs\ che si trova nella directory principale della soluzione VS2015.
  4. Chiudere Visual Studio e lanciarlo nuovamente con privilegi di amministratore (tasto destro > Esegui come Amministratore).
  5. Modificare la URL casuale generata dal progetto: dalla GUI di Visual Studio, tasto destro sul nodo principale del progetto nel Solution Explorer, quindi selezionare Proprietà; selezionare la tab Web, quindi modificare il numero di porta presente nella casella di testo denominata URL del progetto.
  6. Aggiungere la variabile di sistema _CSRUN_DISABLE_WORKAROUNDS assegnandole valore 1 come mostrato dalla screenshot seguente (un grazie a Juan M. Elosegui per aver menzionato questa soluzione in questo topic sul sito StackOverflow e per l'immagine):

Process with an ID #### is not running con Visual Studio 2015 - Come risolvere

Nell'eventualità in cui riusciate a risolvere il problema, vi invitiamo a farci sapere quali tra i workaround indicati ha sortito l'effetto sperato lasciando un feedback nei Commenti in fondo a questo articolo.

Per il momento è tutto: felice workaround!

 

 

 

 

 

 

 

 

If you're working with Visual Studio on recent Windows versions, such as Windows 10, you might stumble upon the following error when trying to open an ASP.NET Core or MVC solution:

Process with an ID #### is not running on Visual Studio 2015

If you look to the Visual Studio error log window panel, you should also see something like that:

This is clearly an IISExpress error. It's worth noting that the solution will still be launched in debug mode, but the web browser will be unable to connect to the application, giving the following permanent error:

Unable to launch the IIS Express Web server.

The start URL specified is not valid. https://localhost:#####/

There are many workaround that might fix this issue: we suggest to try them one after another, stopping only when you manage to fix it.

  1. Delete the \Documents\IISExpress folder using the following console command: rmdir /s /q "%userprofile%\Documents\IISExpress"
  2. Delete the applicationhost.config file which is placed within the \.vs\Config\ folder in your Visual Studio project root folder.
  3. Close Visual Studio and re-start it with Administrative priviledges (right-click > Run as Administrator).
  4. Change the project's website random URL: within Visual Studio, right-click to the project node in Solution Explorer, then select Properties; navigate through the Web panel, then change the number in the Project Url textbox value.
  5. Add the _CSRUN_DISABLE_WORKAROUNDS Environment System variable with the value of 1 as shown in the following screenshot (thanks to Juan M. Elosegui for reporting this on this SO thread and for the image):

Process with an ID #### is not running con Visual Studio 2015 - Come risolvere

In case you manage to fix the issue, let us know which of the given workarounds worked for you by leaving a feedback in this post's comment section.

That's it for now: happy coding!

About Ryan

IT Project Manager, Web Interface Architect e Lead Developer di numerosi siti e servizi web ad alto traffico in Italia e in Europa. Dal 2010 si occupa anche della progettazione di App e giochi per dispositivi Android, iOS e Mobile Phone per conto di numerose società italiane. Microsoft MVP for Development Technologies dal 2018.

View all posts by Ryan

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *


The reCAPTCHA verification period has expired. Please reload the page.

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.