简体   繁体   中英

Running ASP.NET Core Angular template on Kestrel server?

I am trying to run the ASP.NET Core angular template on a kestrel server. It works flawlessly on ASP.NET, but when I change in the launchsettings in Visual Studio from IIS Express to my project name, it opens a command window where I can see the log and everything, but the browser returns a 404 error. This is what my launchsettings look like:

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:59994/",
      "sslPort": 0
    }
  },
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "Sankini": {
      "commandName": "Project",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "Production": {
      "commandName": "IISExpress"
    }
  }
}

What can I do to make sure it works?

You will want the IISExpress server to serve your Angular App.

The NameOfEnvironmentWhenAppRuns is the name you assign the run button. Like so.

在此处输入图片说明

在此处输入图片说明

So to answer your question the following will work.

    "Sankini": {
        "commandName": "IISExpress",
        "environmentVariables": {
            "ASPNETCORE_ENVIRONMENT": "Development"
        }
    }

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