简体   繁体   中英

Hosting AspNetCore.SpaTemplates Project on an IIS Server

My company is using ASP.NET for a few tools, and I thought I'd give using .NET Core and Angular a shot. I built my project out, tested it, published it, and set it up in IIS.

发布

文件

迪尔

Unfortunately, the error message isn't very descriptive. I was wondering if anyone else ran into an issue like this when using .NET Core and Angular 2 with IIS. I'm guessing I missed something in the setup?

IIS

错误

Thanks in advance!

Edit:

I updated my web.config based on @Eliseo's feedback:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <remove name="aspNetCore"/>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\BrightApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
  </system.webServer>
</configuration>
<!--ProjectGuid: 805b51a9-21a4-4f6f-8eb6-74955992b4d6-->

it's look like there are a problem with you web.config. My web.config in my PC is slightly different, I have to add remove name="aspNetCore"

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

Check too that the name of your application have no spaces and try to write in console

dotnet MyAplication.dll

Sorry, I hope this help you, but I don't know more

After hours of troubleshooting and stack-overflowing, I was able to resolve this issue by following first time setup guides for IIS (just to double check everything), restarting IIS, and opening the port on the firewall.

In hindsight, this was a bad question because the answer could have been a great number of things.

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