Microsoft MVPDNN MVPXamarin Certified
I'm Andrew Hoefling, and I work for FileOnQ as a Lead Software Engineer building mobile technologies for Government, Financial and First Responders using Xamarin.
A how-to guide by a Developer for IIS and ASP.NET Core on Windows Server Core
Increasing performance on your Windows Server may be as easy as getting rid of the desktop enviornment, now your server is focusing more on running your apps instead of the desktop enviornment.
At bare minimum to get an ASP.NET Core Web App running you will need IIS installed and the ASP.NET Core Module. What makes this so difficult? The lack of desktop enviornment means you need to run scripts and commands to configure everything!
Let's Get Started, go ahead log in and open up powershell
Install-WindowsFeature -name Web-Server -IncludeManagementTools
That is all you need to do to install IIS!
wget https://download.microsoft.com/download/1/f/7/1f7755c5-934d-4638-b89f-1f4ffa5afe89/dotnet-runtime-2.1.2-win-x64.exe -OutFile dotnet-runtime-2.1.2-win-x64.exe
& "C:/Users/App/Downloads/dotnet-runtime-2.1.2-win-x64.exe" /quiet
That is all you need to do! To confirm dotnet core is installed trying running the following command:
You can't access the IIS Manager from Windows Server Core, so we need to configure IIS Remote Management. This will allow us to remotely log in to IIS and manage our apps.
sc config WMSVC start=auto
net start WMSVC
Now that we have the IIS Remote Management we need to open up the firewall so we can remotely connect.
netsh advfirewall firewall add rule name="IIS Remote Management" dir=in action=allow service=WMSVC
netsh advfirewall firewall add rule name="IIS Remote Management" dir=in action=allow protocol=TCP localport=8172
If your server is behind any type of network firewall you will need to open the following port
If you do not have the IIS Manager for Remote Administration Extension installed you will need it before connection:
Now you can open IIS Manager on your other machine and connect, enjoy the performance benefit of a server that doesn't have a Desktop Environment. Have fun connecting from your other machine using IIS Manager