0

I'm trying to deply an ASP NET Core 2.0 full framework app to IIS in Windows Server 2012 R2 and keep on failing. The app runs fine locally in VS2017 and also works on the server when I manually run the EXE and connect to the kestrel server on localhost:5000. However trying to host in IIS always results in an error 500 from IIS.

I've followed the instructions on https://docs.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x but I don't see any mentions of setting up for asp net core 2 with full framework (instead of net core). the app uses EF6, so it targets full .net framework 461. the .NET Core Windows Server Hosting bundle is installed, and server rebooted afterwards. there are also other standard asp.net websites running on the server. the asp net core iis site is configured according to instructions with app pool set to "No managed code".

the web.config is

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath=".\appng.exe" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
        <httpErrors errorMode="Detailed" />
  </system.webServer>
</configuration>
<!--ProjectGuid: c458df4b-f145-427d-9bfb-5959b2a0932b-->

enabling the stdout logging in web.config shows the following error:

Hosting environment: Production
Content root path: C:\inetpub\appng
Now listening on: http://localhost:17402
Application started. Press Ctrl+C to shut down.
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HL7V7O2GO450", Request id "0HL7V7O2GO450:00000001": An unhandled exception was thrown by the application.
System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section runtime. (C:\inetpub\appng\appng.exe.Config line 3)

the contents of appng.exe.config is:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.Serialization.Xml" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.3.0" newVersion="4.1.3.0" />
      </dependentAssembly>
    </assemblyBinding>
... [lots more assemblybindings]
  </runtime>
</configuration>

this is where I've tried for searching any errors related to that but simply cannot find anything.

any help will be greatly appreciated.

  • did you have any luck tracking this down? I am having similar issues trying to track down an error in .net Core 2.0 – stoj Oct 17 '17 at 17:54
  • still no luck. opened github issue, also unresolved. I set up a new web server VM since I could not figure out a solution... – Tom Oct 18 '17 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.