How to Host an ASP.Net 6 Application In IIS Using AspNetCore Hosting BundleClick to Watch Video

Unable to bind to localhost on the IPv4 loopback interface: An attempt was made to access a socket in a way forbidden by its access permission


Question: How to run a Console Application with Dependency Injection, then click on run the error "Unable to bind to localhost on the IPv4 loopback interface: An attempt was made to access a socket in a way forbidden by its access permission" is written to the Console.

Any idea how to solve it?


Login to See the Rest of the Answer

Answer:
This error is most likely to happen when you have another application listening on the same port. Another theory is that you are trying to use the Console Application as a web application that requires a Home or Index Razor File. If you are trying to make a Console Application do an ETL like Job Scheduler then you should look into creating an API and then just call the URL endpoint. 

Let me know what your scenario is in the comments below.






© 2024 - ErnesTech - Privacy
E-Commerce Return Policy