The first step is to ensure IIS is installed on the VM. Open the browser and type localhost to ensure IIS is running. Or type inetmgr in Run. If it is not working this means IIS is not installed.
Install IIS
1. Open the control panel
2. Go To Programs And Features
3. Click on Turn Windows Features on or off
4. Click on Internet Information Services (IIS)
5. Press Ok
It will install IIS on your system. Now when you type localhost in browser and you can see the below screen.
6. Go to run and type inetmgr and press enter, you can view IIS as having a default website.
7. You can publish your code to Default Web Site or create a new Website.
8. Let's publish your code on the default website. Right-click on the default website and click Explore. Publish your code and paste it here.
9. Open the browser and type localhost. You can see your website is running. If you are getting below error
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
This means you need to install the .Net Runtime on your VM. My API is in .Net 7. So, I am downloading .net 7 from the link below or from Google based on the specific version. You can download .Net Core based on your .Net core version.
10. Hurrah, now you can see your website is running.
This is all about this article. Thank you.