Troubleshooting an ASP.NET Core 7.0 MVC Web Application
I have an Amazon EC2 Windows instance running an ASP.NET Core 7.0 MVC web application (Hello World). I installed .NET 7.0 before deploying, building and running the HelloWorld app using dotnet run
.
The following code is used to configure the web application:
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.Run();
The launchSettings.json
file is configured as follows:
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5223",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7174;http://localhost:5223",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
In order to access the application, the following ports are open with the Security Group:
- HTTPS 443
- HTTP 80
- WebApp HTTP 5223
- WebApp HTTPS 7174
- RDP 3389
The following screenshot shows the Inbound Rules configured in Windows Defender Firewall with Advanced Security:
The problem is that I’m unable to access the Hello World app using the Public IPv4 address or Public IPv4 DNS provided by the EC2 instance.