Answered by:
Why my website can not works in IIS of Windows Server 2019?

Question
-
User1052024640 posted
I have a website made by asp.net core 3.1.
It is the first time I publish it on Windows server 2019 Datacenter 1809(17763.1158).
However, it doesn't work but the IE reports ''Can’t reach this page' error on the page.
I run the .exe file in the directory of the project on the server computer. It starts a command-line and showed these:
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
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: Production
info: Microsoft.Hosting.Lifetime[0]
Content root path: C:\ProjectI access the http://localhost:5000. All works well now.
I have not only ensured set the .NET CLR version to No Managed Code but also ensured there is an AspNetCoreModuleV2 in the module.
I doubt whether it is the problem of DNS or URL. After I set the Host Name to null to make the website only works locally, it still no works.
What's wrong with it? How can I solve this? Thank you.
---------------------------------
PS: Here is some information with dotnet --info of the server computer
Microsoft Windows [Version 10.0.17763.1158]
(c) 2018 Microsoft Corporation. All rights reserved.C:\Users\Administrator>dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.201
Commit: b1768b4ae7Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.201\Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8.NET Core SDKs installed:
3.1.201 [C:\Program Files\dotnet\sdk].NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-downloadC:\Users\Administrator>
Thursday, April 23, 2020 9:06 AM
Answers
-
User1052024640 posted
Problem solved. The server computer has blocked the 80 port.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, April 23, 2020 12:02 PM
All replies
-
User475983607 posted
If I understand correctly, you successfully started the application from the command line.
dotnet run
You can access the access the application and the application works.
The problem is you are unable host the application in IIS. The error message means the URL is not resolving or there is a configuration problem. The community cannot see your IIS configuration. I recommend verifying DNS is correct, your site bindings are correct, and SSL is setup correctly. Please see the standard ASP.NET Core deployment troubleshooting for a list of items to check.
https://docs.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-3.1
Thursday, April 23, 2020 10:29 AM -
User1052024640 posted
Problem solved. The server computer has blocked the 80 port.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, April 23, 2020 12:02 PM