Introduction
in this article, we will learn about how to deploy the asp.net core 5 website on a server using Visual Studio 2019.
Step 1 - Account Setup on Server
The first step for deploying Asp.net Core Web API is to create an Account on the hosting provider website that supports the asp.net web application framework and then follow the steps in the given article
- Create a Website in the hosting panel.
- Then create the SQLServer Website using the Hosting Panel
Step 2 - Create the project asp.net Core 5 Web API using VS-2019
Create the project using visual studio and select the asp.net core version .Net 5.0 Current.

Give the Name of the project that you want to develop. My Project is ONP (Online Prescription Application).

Step 3
Set the Live Server Database Connection string in your Application appsetting.json file,
{
"DefaultConnection": "Data Source=SQL5108.site4now.net;Initial Catalog=YOUR ONLINE DB NAME;User Id=YOUR ONLINE DB USERNAME;Password=YOUR ONLINE DB PASSWORD"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
Step 4 - Publish Your Project
After Creating your project and Final Testing from QA Section now it's time to deploy our website. Now go to solution explorer in visual studio 2019.

Now right click on your project and select the option to publish.

Click the Publish option, a new window will appear. Now select the project publication option here you have 5 to 6 options given below,

Now select the option Import to publish profile.

After selecting the option Import Profile click next.

But here a question will probably come to mind -- how to get the published profile. Just log in to the hosting server that supports Asp.net core website applications and then go to deployment option and get the publish profile file and download in your local system.

You get this option in your control panel just get the publish profile from and download that file in your system.












Join the conversation! Your thoughts help the community grow.