0

I am working on a Dot Net 6 and Angular 13 based application. When I run application from Visual Studio, it works fine and open the desired port for API and Front-End but when I publish this application using DotNet command from Visual Studio Code, it defaults to port no. 5000 and 5001 but when I open these ports in browser, it returns the 404 error. I am using following commands -

dotnet build -c Release
dotnet publish -c Release --no-build
dotnet bin\release\net6.0\publish\app.web.dll

Here is the response of the above command - 

info: XXXX.configurations.AppConfigBuilder[0]
  Looking in D:\XXXX-v2.0\web\src\web for the appsettings file
info: Microsoft.Hosting.Lifetime[14]
  Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[14]
  Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
  Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
  Hosting environment: (null)

I am not sure what is going wrong. Any pointers will be helpful.

Anil C
  • 1,045
  • 3
  • 16
  • 38
  • Was not able to reproduce the behaviour. Can you please post more details? Or better [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)? – Guru Stron Mar 11 '22 at 13:04
  • If you create a new angular and dot net core application and try running it from the published code using visual studio code, you’ll see that it runs application using port number 5000 & 5001 and if you open these ports in browser you’ll get 404 error – Anil C Mar 13 '22 at 16:44

0 Answers0