Visual Studio 2022 Web server failed to listen on port 7189
Asked Answered
A

10

9

The program '[25472]' has exited with code 2147516553 (0x80008089).

  • I have closed and re-opened visual studio.

  • I have restarted my computer.

  • I have shut down my computer.

  • I deleted bin and obj. Clean and Rebuild.

  • I deleted .vs. Clean and Rebuild.

  • I deleted the entire repo and re-pulled it down.

  • I changed Ports in the debug config

  • I deleted the IIS Express Configuration files

  • I had a co-worked who is using VS 2022 pull the same repo down and it worked for him.

I am using .NET 6.

I am out of ideas, any and all help would be apricated.

Appressed answered 21/4, 2023 at 20:1 Comment(0)
A
2

In the end I had to go into Visual Studio Installer and repair my installation. Once that was complete, everything ran fine.

Appressed answered 26/4, 2023 at 19:40 Comment(0)
F
8

In my case, what led me to the solution was to activate all exceptions (Debug -> Windows -> Exception Settings, check all the boxes). After that I got a proper error pointing me to a recent change in DB that was preventing my application from starting. Good luck!

Fop answered 13/12, 2023 at 11:43 Comment(2)
Ooh - this is the only thing that helped my case. Doing this caught the fact that a silly little change was causing my startup code in Program.cs to throw, which manifested itself as "web server failed to listen on port...". Thanks!Midterm
Glad it helped :)Fop
C
3

I had the same problem appear after a Windows update and repairing and updating Visual Studio 2022 did not fix it and I had no idea what was going on. My issue was that .NET 7 SDK had an update that needed to be installed. I don't know if some people have it install automatically but I have to do it manually and that fixed the problem.

It was hard to tell because I usually run the project with https instead of IIS Express as the launch setting and it shows the "failed to listen on port 7189" error, and the browser does not open even though it is set to "launchBrowser: true". Once I switched to IIS Express the browser opened and showed the .Net version error, and then it was pretty simple to solve from there. Something like this happens every so often and I always forget to check.

https://dotnet.microsoft.com/en-us/download

enter image description here

Cosher answered 11/10, 2023 at 16:51 Comment(1)
After screwing around for an hour with this problem, this was the solution. I know I experienced this at least once before, but couldn't remember what was the cause.Alaric
C
3

In my case I run this command and see the real error in cmd:

dotnet run --project /projectfolder/projfile.csproj
Cutting answered 11/1, 2024 at 16:28 Comment(0)
I
3

I doubt many devs will run into this, but this happened to me after I accidentally deleted the app.Run() command in Program.cs. Doh!

Ivanna answered 23/3, 2024 at 19:23 Comment(1)
You doubt, eh? Well, I have news for you. :) Thanks.Pliske
H
3

I spent almost 10 hours on this issue .

and later on I found that it was showing me the actual error in project.exe command window ,

which opens when we try to run the project , even it was giving me the link also to download the required version of hosting bundle .

Thank god :)

the link was

download .net core 3.1 hosting bundle

enter image description here

Hypogynous answered 14/5, 2024 at 8:50 Comment(0)
A
2

In the end I had to go into Visual Studio Installer and repair my installation. Once that was complete, everything ran fine.

Appressed answered 26/4, 2023 at 19:40 Comment(0)
F
1

In my case the issue was with the .Net version installed, my project was running on .Net 6 and I have not installed this version kindly check which version you have installed and also the project will run if it is backward compatible.

Fibrilliform answered 21/2, 2024 at 5:0 Comment(0)
M
1

In my case i sloved this error by changing the connection string by adding this Persist Security Info=false

Midgut answered 11/4, 2024 at 5:56 Comment(0)
C
1

Even if you have .NET 6 (or 7) SDK installed, you should check if this version does not have any updates. Reinstalling SDK with newest version worked for me.

Cristencristi answered 17/6, 2024 at 8:19 Comment(0)
C
0

In my case I just changed the solution from multiple startup projects to starting just the project who was having this problem, run the solution, it worked, then moved back to multiple startup projects and the problem was solved for some reason.

Costa answered 5/9, 2024 at 16:30 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.