In my recently developed ASP.Net 7 application, I have the following in y program.cs
app.UseHttpsRedirection();
And my launchSettings.json is as follows:
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:52163",
"sslPort": 44396
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5150",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7253;http://localhost:5150",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
I am able to launch the application from Visual Studio but when I publish it and try to run it with powershell with the following command
dotnet projectName.dll
I get the following output indicating that it is running on port 5000
Now listening on: http://localhost:5000
but when I navigate to http://locahost:5000, I get the following on the brwser[![enter image description here][1]][1]
I have also tried to check the application on http://localhost:7253 and on https://locahost:5150 but I keep getting the following:
[![enter image description here][2]][2]
Please how can I resolve this issue
Thank you [1]: https://i.stack.imgur.com/Nq5P4.png [2]: https://i.stack.imgur.com/ajSa4.png