question

CoreyFleig-6304 avatar image
0 Votes"
CoreyFleig-6304 asked BruceZhang-MSFT commented

Unable to connect to web server "IIS Express" ... its baaaackkk

I've done everything stackoverflow mentioned:

  1. Deleted the .vs folder

  2. Initalized a new AppSettings.json file

  3. Changed the port number

  4. Rebooted

Nothing works. I'm still getting the error.

It doesn't make sense that I should delete the bin and/or obj folders. I have several projects, and they all have the same error.

What's the real issue here? Anyone know?

I have VS 2019, build 16.4.3, with .Net 4.8



windows-server-iisdotnet-aspnet-core-general
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

BruceZhang-MSFT avatar image
0 Votes"
BruceZhang-MSFT answered BruceZhang-MSFT commented

Hi @CoreyFleig-6304 ,

What kind of application and what .NET version you use? Something I think you can try and if anything wrong or abnormal, I need your feedback.

  1. Try to create an empty asp.net or asp.net core application and run it in IIS Express directly. Please tell me the result.

  2. Delete .vs\config\applicationhost.config file, then right click on prject solution -> properties -> debug tab ->web server settings, change port number to be different from all other applications. Restart VS and rebuild solution.



If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Best regards,
Bruce Zhang


· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I've tried deleting .vs lots of times, and it didn't solve anything.

However, changing the port number did. So that's my solution. I wonder why that's needed sometimes?

IF you want to provide this as your answer, I'll flag it answered for you!

Thanks so much!!!!

0 Votes 0 ·

BTW -

my project is a MVC Core 3.1 project with N-Tier architecture, and I use UnitOfWork.

When I created the project I chose the Core 3.1 library. I have no idea if I should rebuild
using the .Net 5 library, or upgrade VS 2019, or even move up to 2022.

A big change like 2022 kinda scares me.

0 Votes 0 ·

Hi @CoreyFleig-6304 ,

From what I've tried, this problem all happens randomly. But I think it's likely that IIS express is still listening on the original port because it didn't exit normally. This means that the initial port is still occupied by the process. When deleting the applicationhost.config file of IIS express and changing the port, IIS express uses another port which is not occupied by other processes and everything works.

0 Votes 0 ·

@BruceZhang-MSFT

That was a very satisfying answer - thanks!!! You should consider being a therapist, cuz you helped me calm down!

Corey

0 Votes 0 ·
Show more comments