1

I've read many similar issues but none of the resolutions solved my problem. So, here is my case.

I have a NET Core 2.1.1 app that runs beautifully within VS2017 and when published to my desktop running Win10 Pro and IIS10, i.e. running it outside of VS2017. But, when I deploy the app to a remote server Win2012 R2 with IIS8.5, I get the following issues with it.

I have followed different pages on deploying net core apps like this one. https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.1

  1. When attempting to reach the site I get error 500 Internal Server Error.

  2. IIS manager complains about the generated web.config when clicking on any of the site's settings e.g. Net authorization, Net Error pages etc...

  3. Even when setting the stdoutLogEnabled to true, I don't get any log files. I even tried adding custom details flags in the web.config yet still nothing changed.

This is the generated web.config, and I hope someone points me in the right direction.

Thanks.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\eSignWebMVC.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 72897161-bbbb-4f20-a12c-7f33922ea6bc-->
Ninos
  • 224
  • 4
  • 18
  • I'd start with trying to execute the command `dotnet .\eSignWebMVC.dll` in the site's directory on the target web server. does the server start from there? – Alex Buyny Mar 03 '19 at 23:29
  • @Ninos hi! what does the event log says? have you tried starting the site from code behind? if yes, did you get any errors? – SteinTheRuler Mar 04 '19 at 03:42
  • So you are positive you have installed the Runtime & Hosting bundle for your targeted 2.1 version from here https://dotnet.microsoft.com/download/dotnet-core/2.1 It should be that one, under 2.1.8: "ASP.NET Core/.NET Core: Runtime & Hosting Bundle" – Daboul Mar 04 '19 at 16:48
  • Hi Alex, running "dotnet .\eSignWebMVC.dll" gives this error. – Ninos Mar 05 '19 at 17:37
  • warnHosting environment: Production Content root path: C:\webapps\app_mvc : Microsoft.AspNetCore.Server.Kestrel[0] Unable to bind to https://localhost:5001 on the IPv4 loopback interface: 'An attempt was made n a way forbidden by its access permissions'. Now listening on: http://localhost:5000 Now listening on: https://localhost:5001 Application started. Press Ctrl+C to shut down. – Ninos Mar 05 '19 at 17:38
  • Yes Daboul, that's exactly what I've installed for 2.1.1 – Ninos Mar 05 '19 at 17:39
  • TheRuler, I don't get any log files, no "logs" folder created in the app's folder and even if I give it an explicit path no files get generated. – Ninos Mar 05 '19 at 17:40
  • I had a service running against port 5001 on the box, but even though changing the launchSettings.json file to point to different ports and deploying again and running "dotnet .\eSignWebMVC.dll" it still complained about unable to bind to localhost:5001. Then, I stopped the service that was running on port 5001 and ran again "dotnet .\eSignWebMVC.dll" and I got no error, but still can't reach the site. Still getting Internal error 500. And still no log files being generated. – Ninos Mar 05 '19 at 18:13
  • ok I think I'm getting somewhere, now I can navigate to https://localhost:5001 but getting null references when trying to use the app. My question now is, why do I still get Internal Server error, when navigating to the site from the IIS binding? I want the site to be hosted in IIS after all. – Ninos Mar 05 '19 at 18:19
  • Absolutely nothing is working for me. Still getting the 500 Internal server error and the site keeps considering the web.config invalid when clicking on any of the site's setting icons, like ASP icon click gives error "There was an error while performing this operation. Details Filename \\?\C:\webapps\myApp\web.config, Error:" – Ninos Mar 05 '19 at 22:58
  • Do I need to upgrade my Win 2012 server R2 to Win 2016 and to get IIS 10 to have this thing work?? How horrible Microsoft technology is, they make something that doesn't work on their own technology! – Ninos Mar 05 '19 at 23:13
  • Whenever you see errors in IIS Manager on `web.config` of such an ASP.NET Core app, it is likely that the server bundle is missing or not installed properly. Based on your description, the installer for 2.1.1 failed, while 2.2.2 worked. Not surprising though, as the installer carries out several operations and can fail miserably. You might report such issues to Microsoft via https://github.com/aspnet/AspNetCore/issues but 2.1.1 is long dead, as Microsoft only supports the latest (2.1.8 right now). – Lex Li Mar 06 '19 at 02:27
  • Lex Li, the 2.1.1 installer did not fail, at least didn't give any indication that it did. I also installed 2.1.2 through 2.1.8 and all ran successfully but none solved the issue. I think Microsoft has lots of issues to resolve. If they support or not a version of anything, when they still host those historic versions they better work, if not they should completely take them out. – Ninos Mar 07 '19 at 17:14

1 Answers1

1

So I finally got this to work and I HAD to install the latest bundle v2.2.2 even though my app is targetting Net Core 2.1.1, but Microsoft's horrible technology still didn't make the app to run with the 2.1.1. bundle. Total waste of time and effort on such a stupid thing!!

What's the meaning of still providing the prior bundles if none of them does anything?

Ninos
  • 224
  • 4
  • 18