0

I am a beginner with IIS and razor pages. Currently, I am trying to deploy an internal web-site built using net core written using razor pages, but it keeps giving a server HTTP Error 500.19 - Internal Server Error.

This is an internal web-site so not open to world. I looked at this thread and installed the components they mentioned by did not help.

How do I resolve "HTTP Error 500.19 - Internal Server Error" on IIS7.0

As a test this is just the webapplication1 template code that is created with the wizard. So I have this on launchsettings.jon. Noted that I added the https://myinternalsite.net/ which is the URL mapped. Not sure if this is necessary.

Properties\launchSettings.json

"profiles": {
    "IIS Express": {
        "commandName": "IISExpress",
        "launchBrowser": true,
        "environmentVariables": {
            "ASPNETCORE_ENVIRONMENT": "Development"
        }
    },
    "WebApplication1": {
        "commandName": "Project",
        "launchBrowser": true,
        "applicationUrl": "https://localhost:5001;http://localhost:5000;https://myinternalsite.net/",
        "environmentVariables": {
            "ASPNETCORE_ENVIRONMENT": "Development"
        }
    }
}

I tired to deploy using "Folder", currently the url is mapped to the server @:

C:\inetpub\wwwroot\

However I am publishing the site directly inside the server with "Publish" to folder as below:

enter image description here

Here are the IIS packages installed:

enter image description here

But one thing that bugs me is that when I deploy to the local folder I see this:

C:\inetpub\wwwroot\wwwroot

two nested wwwroot folders! Not sure if this is the problem.

enter image description here

but this what I get, when trying to deploy there:

enter image description here

but If I try to deploy to C:\inetpub, I get different errors like this:

enter image description here

gmmo
  • 2,577
  • 3
  • 30
  • 56
  • The 404 error page is irrelevant, as double wwwroot is expected. Show your 500.19 error page please, and that's the key. (When reading other 500.19 posts, check the Module and Error Code to make sure you read a similar thing. If Module and Error Code differ, that post can be irrelevant to your case.) – Lex Li Aug 12 '20 at 02:24
  • I suggest you could firstly make sure you have installed the asp.net core runtime before you want to host the asp.net core application on IIS. Asp.net core module download [url](https://dotnet.microsoft.com/download). – Brando Zhang Aug 12 '20 at 05:27
  • Missing component is not the problem, I have VS2019 installed onto the server and it definitely has the .net core 31. – gmmo Aug 12 '20 at 17:48
  • Lex Li I added the error page, if you don't mind taking a look. thx! – gmmo Aug 12 '20 at 17:54
  • As far as I know, the error shown would point towards that module missing...(and it's required). Please make sure ASP.NET Core Module(hosting bundle) is installed in IIS. You could download from this [url](https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-aspnetcore-3.1.7-windows-hosting-bundle-installer). – Brando Zhang Aug 13 '20 at 07:32
  • @gmmo Make sure you have setup default page correctly, 403 forbidden basically happened because you haven't setup your default page correctly, please refer to https://windowswebhostingreview.com/troubleshoot-403-error-when-publishing-asp-net-core/ – TheGunners Aug 18 '20 at 07:33

1 Answers1

0

I found out the issue, but not sure why it happened. To get it work, from my local machine I did "publish to folder" as above. My machine has all the .net core 3.1 installed. Then I copied my entire local binary folder to the remote server. Then I changed the IIS to point to this folder and it worked.

For whatever reason that I don't understand, building the web-project inside the sever did not work, but if I do it locally and copy the all the binaries there it worked.

VS2019 installed onto the server must be missing something, which I have not idea what it is.

thanks for all the tips in all cases.

gmmo
  • 2,577
  • 3
  • 30
  • 56