Deploy an ASP.NET Core application to IIS

ASP.NET Core application

ASP.NET Core is a cross-platform and open-source framework that is used to build modern web apps, API services, and many more. Let's see how to deploy the ASP.NET Core application in IIS.

Requirements

1) .NET Core SDK installed on the development machine.

2) Install the .NET Core Hosting Bundle on the IIS server. The bundle installs the .NET Core Runtime, .NET Core Library, and the ASP.NET Core Module. The module allows ASP.NET Core apps to run behind IIS.

3) On the IIS server, create a folder to contain the app's published folders and files.

Publish and deploy the app

From Visual Studio : 

1) Right-click on the project in Solution Explorer and select Publish.

2) In the Pick a publish target dialog, select the Folder to publish option.

3) Set the Folder or File Share path.

- If you created a folder for the IIS site that's available on the development machine as a network share, provide the path to the share. The current user must have write access to publish to the share.

- If you're unable to deploy directly to the IIS site folder on the IIS server, publish to a folder on removable media and physically move the published app to the IIS site folder on the server, which is the site's Physical path in IIS Manager. Move the contents of the bin/Release/{TARGET FRAMEWORK}/publish folder to the IIS site folder on the server, which is the site's Physical path in IIS Manager.

From .NET Core CLI : 

1) In a command shell, publish the app in Release configuration with the .net publish command:

> dotnet publish --configuration Release

2) Move the contents of the bin/Release/{TARGET FRAMEWORK}/publish folder to the IIS site folder on the server, which is the site's Physical path in IIS Manager.

Post a Comment

If you have any questions or concerns, please let me know.

Previous Post Next Post