简体   繁体   中英

ASP.net core 2.1 not loading in IIS

Im having an issue with a aspnet dotnet core 2.1 app not running in IIS. There nothing in the event viewer, the server simply isnt responding (chrome states "[hostname] failed to connect."

  • Ive installed visual c++ 2015 version 3.
  • Ive installed dotnet-hosting-2.1.3-win.
  • Ive rebooted my machine
  • I've restarted IIS
  • Ive created the directory "logs/stdout".
  • Ive set stdoutLogEnabled="true" to see if I could get an error message.
  • Ive configured the appool to be "no managed code".
  • Ive set the app pool to run as an administrator user.
  • Ive set permissions on the application directory to everyone recursively.
  • Ive checkd under sites[mysite]\\modules to ensure "AspNetCoreModule" is listed there and it is.

But nothing I do gives me any information to go on.

If I run the app via "dotnet.exe ./[application].dll" it is started on port 5000 and I can browse to it and it works just fine.

What step am I missing? How can I get a proper response from IIS to see what the error is?

This is a Windows Server 2016 machine. Same results on my Windows 10 dev box.

Update: Ive followed https://neelbhatt.com/2018/01/30/deploy-net-core-application-to-iis-step-by-step-guide/ and same results. Cant get it to load at all.

The issue with publish on asp.net core 2.1 can be fixed as following. Put code below on web.config that is generated after publish and give a try.

<?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=".\Web.dll"
        stdoutLogEnabled="false"
        stdoutLogFile=".\logs\stdout">
        <environmentVariables>
          <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
        </environmentVariables>
      </aspNetCore>
    </system.webServer>
  </location>
</configuration>

I set a custom hostname, but forgot to update the host file. Well that was stupid of me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM