Wednesday, September 21, 2022

setting up IIS with dot NET core on Windows 10 - but Linux is better!

Setting up IIS and dot NET core for Windows 10 - this may be slightly different for Windows 11 and or Windows Server OSes.

1. Installing IIS - Control Panel - Programs and Features - Turn Windows Features on or off - choose IIS, IIS manager, (optionally open them up and select all the features like FTP and so on if needed).

2. Installing the dot NET Hosting bundle and deployment - First download and install dot NET core hosting bundle - googling found the updated link here - https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-6.0.8-windows-hosting-bundle-installer. Then "publish to folder" in Visual Studio. Then copy to the relevant folder inside the relevant IIS website.

3. Create application in IIS - (a) create a new IIS Application Pool under the .NET CLR version of “No Managed Code”.  
(b) choose Add Application for the relevant website, use the Application Pool listed above, and the folder to which the deployed app was copied
(c) and now if the website is enabled, the app should be working.

Apparently, we can try and run dot NET web apps on Linux also, 

https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#1804-

We can run console app with 
dotnet myApp.dll
 or we can publish a standalone version with
dotnet publish -c release -r ubuntu.16.04-x64 --self-contained
and run it after copying it to the Ubuntu server with
chmod +x ./appname
./appname

as in the post below.

https://stackoverflow.com/questions/46843863/how-to-run-a-net-core-console-application-on-linux

Complete howto on deploying and running on an Ubuntu server - 
https://www.c-sharpcorner.com/article/how-to-deploy-net-core-application-on-linux/

Apparently, there is a nearly 50% performance boost by running on Linux!
https://stackoverflow.com/questions/44334125/net-core-on-windows-vs-linux
https://robertoprevato.github.io/More-about-Linux-vs-Windows-hosted-ASP-NET-Core-applications-in-Azure-App-Service/


No comments:

Post a Comment