3

I've got an older server, which I've installed all the most recent Core Web-Hosting Modules, for Internet Information System (IIS). The server should be up to date.

For some odd reason I receive the following error:

HTTP Error 500.19 - Internal Server Error The configuration section 'aspNetCore' cannot be read because it is missing a section declaration.

The web.config is as follows:

<?xml version="1.0" encoding="utf-8">
<configuration>
     <system.webServer>
          <handlers>
               <add name="aspNetCore path="*" verb="*"
                    modules="AspNetCoreModule" resourceType="Unspecified" />
          </handlers>
          <aspNetCore processPath="dotnet" arguments=".\LicenseManager.dll"
               stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
     </system.webServer>
</configuration>

I'm positive that the Application Pool is configured correctly with proper permissions to the directory, the Application Pool is also set to No Managed Code, and the bindings have been configured.

The documentation also stated that it is indeed compliant and supported by Windows Server 2008 R2, which includes IIS 7.0.

I've run their commands, any thoughts why this won't publish?

Greg
  • 11,302
  • 2
  • 48
  • 79
  • I don't know about Asp.Net Core, but typically you have to register a config section handler if you add a non-standard section to web.config. See this answer http://stackoverflow.com/a/20066794/21336 and related questions to get an idea. – devio Mar 24 '17 at 20:50
  • @DouglasThomas It is Windows Server 2008 R2, which the documentation says it works on. That is a great link though, I ended up installing on Windows Server 2012 and opening a ticket with Microsoft as to why it isn't working correctly. – Greg Apr 04 '17 at 14:28
  • @Greg Are you sure it can work on Windows 2008 R2? I have tested to install it on my Windows Server 2008 and it didn't work. The error shows incompatible version. I use Windows Server 2012 now and it is working without any issues. –  Apr 05 '17 at 05:18
  • @DouglasThomas click the documentation, choose supported Operating Systems it's listed. – Greg Apr 05 '17 at 12:42

1 Answers1

3

In case it could help, on a 2008R2, IIS7.5 but with an ASP.NET Core built against .NET 452 I have this:

<aspNetCore 
    requestTimeout="00:20:00" 
    processPath=".\MyProject.exe" arguments="" 
    stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" 
    forwardWindowsAuthToken="true">
  <environmentVariables>
    <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="development" /> <!-- value could be "development", "staging" or "production"-->
  </environmentVariables>
</aspNetCore>

Moreover, if you go on IIS, do you actually see the .NET Core module installed:

enter image description here

And can you use the configuration editor to browse your web.config content?

Update: you have changed your question adding the ", so I'm removing this bit in my answer.

Daboul
  • 2,635
  • 1
  • 16
  • 29
  • What about raw core, without a .net to compile against as unmanaged code. – Greg Mar 24 '17 at 12:53
  • I don't have that running at the moment, so I can't tell you for sure, but I'm expecting it to be similar: you'll need to have an AspNetCoreModule installed and running under IIS, you'll still need to be able to parse the web.config via IIS "Configuration Editor", the main difference should be that with the full .NET processPath/arguments will be directly "myexe "/"" while when compiled against .NET CORE it will be "dotnet"/"mydll.dll". In your case I guess "dotnet mydll.dll" is working fine when launched under command line? If so, it's just a matter of configuration of IIS. – Daboul Mar 24 '17 at 12:58
  • I have the module, what's weird it's almost like IIS chokes on the config. – Greg Mar 24 '17 at 15:36
  • Maybe and forwardWindowsAuthToken="" are mandatory. Have you tried changing your web.config as much as possible so that it looks like mine, which is actually working ? – Daboul Mar 24 '17 at 16:04
  • Actually, the web.config correctly works on another server, running Windows Server 2012. So I'm going to try reinstalling the core modules, since it fails to read the web.config. – Greg Mar 27 '17 at 14:29