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:
We open the project through Visual Studio, build it and run it to make sure everything works:
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...".
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.
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.
Then a window pops up in which we click Next up to Server Roles. We carefully find the Web Server (IIS) and install it.
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.
Step 3. After installation, go to the console and restart IIS using the command:
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.
Open IIS Manager using Server Manager, as shown in the picture.
After opening IIS Manager, you will need to add a new website. Right click on “Sites” and then click on “Add 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:
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.
Then your project will open in the browser:
Let’s sum up. Running your project on Windows Server 2012 is neither scary nor difficult. If you have any questions, contact our support.