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.