How to host FastReport ASP .NET Core application in IIS Windows Server 2012

To host the created applications on Internet servers, you need a web server. Today we will launch our web application on IIS (Internet Information Services). It is a web server for hosting sites on the Internet. It is more often used to host web servers under server operating systems with a Windows kernel.

First, we will create the application on ASP .NET Core with the FastReport.Web library or simply use the FastReport.Core.Web21.MVC demo project from the FastReport application .NET Trial  which is located in the path:

"FastReports\FastReport.Net Trial\Demos\Core\FastReport.Core.Web21.MVC"

We open the project through Visual Studio, build it and run it to make sure everything works:

Running a project before publishing

As you can see, the project works properly. Let's prepare it for publication on iis! We launch "Solution Explorer" and right-click on the project, find "Publish...".

Navigation to the publication settings window

At this stage, select the local storage "\bin\Release\Debug", then click publish. A little patience and ta da, the project is ready to be published on IIS.

Publishing a project

Now let's go to Windows Server 2012 itself. The path is something like this:  Server Manager ->  Local Server -> Roles and Features -> Tasks -> Add Roles and Features.

Navigation to the window for adding functions

Then a window pops up in which we click Next up to Server Roles. We carefully find the Web Server (IIS) and install it.

Installing the Web Server (IIS)

Now we need to install dotnet hosting from the official site. Follow step-by-step instructions.

Step 1. Select the required .NET version.
Step 2. Find ASP.NET Core Runtime and click on Hosting Bundle. Just download and install - it seems pretty straightforward.

Downloading ASP.NET Core Runtime

Step 3. After installation, go to the console and restart IIS using the command:

"iisreset"

Restarting IIS

Congratulations, IIS is now fully ready to work with ASP .NET Core!

After all these manipulations, go to the C:\inetpub\wwwroot directory on Windows Server 2012. Create a folder with any name inside. Let's say it will be "coretest". Now we add the project files to this folder.

Creating a folder and adding the project

Open IIS Manager using Server Manager, as shown in the picture.

Opening IIS Manager

After opening IIS Manager, you will need to add a new website. Right click on “Sites” and then click on “Add Website”.

Adding a Website

A window should appear where you will need to specify the name, port (if the default port is busy) and the path to the project:

Creating a Website

That's it, we created the website. To view it, just right-click on the created website, then click on Manage Website, and then on Browse.

Launching a published project

Then your project will open in the browser:

Published Website

Let’s sum up. Running your project on Windows Server 2012 is neither scary nor difficult. If you have any questions, contact our support.