Publish And Deploy .NET 6 Web Application on IIS and Access using Ngrok

Introduction

The first Step is to sign up for Ngrok by providing details.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Click to Signup, and after Sign in, download the Ngrok.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Ngrok is downloaded, so extract this folder.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

After extracting browse the folder and find the file mentioned below.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Double-clicking the executable file will open up CLI.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Run this command to add authentication on the command prompt. 

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

After executing the above command, authentication will be added for you.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Run the following command for HTTP Tunnel forwarding.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

This command will forward port 80, where a locally deployed application can be accessed from the internet.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Now create a new .Net 6 Application for publishing and deploying on IIS and accessing it using Ngrok from the internet.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Select the path for saving the Application files.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Select .NET 6.0 and click on the Create button.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

A .NET 6.0 Application is created.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Click to run this Application.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Now Application is running on localhost that is not deployed on IIS yet.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Now select the project and click to publish it.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Select your desired location to publish your application package. As I created a new folder with the highlighted name.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Select the Folder location to publish the application.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Publish Profile is created.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Click to Publish button to Publish the application.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Publish succeeded.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Click to Open Folder where application files are published.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

You will find the files at the location.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Now open IIS by pressing the Window button and search for IIS that must be already installed on your local machine. If it is not installed, please install and configure it properly for publishing the application locally.

Now browse it as mentioned below.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Now right-click on Default Website and click on Add Application.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Give the Application Alias, select the Application pool, and provide the physical path where we published our application.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Now our application has been published on IIS.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Now right-click on the DemoApplication and browse it. You can see that our application is running on IIS with Alias, as it was given before publishing.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Now we want to access this application via ngrok. Copy the URL provided by ngrok.

Publish & Deploy .NET 6 Web Application on IIS and Access it through Internet using Ngrok

Now paste the URL with your published application alias on the browse and hit enter. You can now see that your application is still responding and running or the URL.

Note: URL Ngrok URL may vary whenever you run it again.

Demo


Recommended Free Ebook
Similar Articles