Step 1 - Launch one windows EC2 instance and Enable the IIS 

Reference - https://www.youtube.com/watch?v=qdFPS1ywlho&t=707s

Step 2 - Install the IIS hosting Engine and dotnet

IIS installation File -

https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-7.0.2-windows-hosting-bundle-installer

Dotnet installation fille

https://dotnet.microsoft.com/en-us/download/dotnet/7.0

MicrosoftTeams-image

Step 3 - Create site and give the whole publish path of the path as the destination.

Put the path where the .exe and related files are located Create a blankApp on Visual studio and build then Start the Application, then publish the site and then copy the publish folder's path and then paste the whole folder into the Window EC2 and mention the same ec2 folder path in the Destination of the IIS site creation

MicrosoftTeams-image

MicrosoftTeams-image (1)

Step 4 - Create the Site in IIS and write click on it.

MicrosoftTeams-image (2)

then type "Users" and check names , after that provide the permission to the Users profile.

Step 5 - Hit the website.

MicrosoftTeams-image (3)

Step 6 - The site that is hosted on the port other than 80 would not be accessible through the outer Internet , for this , we have to manually add the inbound rule in the windows system

https://learn.microsoft.com/en-us/archive/blogs/mandi/how-to-create-a-windows-firewall-inbound-rule