How to configure ASP.NET Core 1.0 to use Local IIS instead of IIS Express?

前端 未结 1 1797
予麋鹿
予麋鹿 2021-01-31 03:06

How can I setup a .Net Core 1.0 project to use Local IIS instead of IIS Express when debugging?

I have tried modifying

相关标签:
1条回答
  • 2021-01-31 03:48

    You currently cannot directly use IIS to host an ASP.NET Core application while developing, as the development folder does not provide all of the necessary files IIS needs to host. This makes running an ASP.NET Core in a development environment a bit of a pain.

    As pointed out in this article by Rick Strahl, there aren't many reasons to try and do this. IIS does very little when running ASP.NET Core apps - in fact your application no longer runs directly in the IIS process, instead it runs in a completely separate console application hosting the Kestrel web server. Therefore you really are running in essentially the same environment when you self host your console application.

    If you do need to publish your app, you can do so to a local folder, using either the dotnet command line, or using the Visual Studio tools.

    For example, if you want to publish to the C:\output folder, you can use the following command:

    dotnet publish
      --framework netcoreapp1.0 
      --output "c:\temp\AlbumViewerWeb" 
      --configuration Release
    

    You can then point your IIS Site at the output folder. Ensure that you set the application pool CLR version to No Managed Code and that the AspNetCoreModule is available.

    For more details, see https://docs.asp.net/en/latest/publishing/iis.html

    0 讨论(0)
提交回复
热议问题