Here we will learn how to publish / deploy asp.net mvc web application directly to server using ftp (file transfer protocol) in visual studio or use file transfer protocol / ftp option in visual studio to deploy / publish asp.net mvc web application in server with example.
In visual studio 2010 or more version we have different options to publish / deploy website directly from visual studio those are web deploy, web delopy package, file transfer protocol (ftp),etc.
If we use FTP (File Transfer Protocol) to publish web application we need to enter all credentials provided by FTP hosting company and application files will upload directly to our ftp hosting space.
Here we will learn step by step process to deploy or publish asp.net mvc web application using FTP (File Transfer Protocol) option in visual studio. To publish and deploy application here we are going to use simple Internet Application which we already created for deployment with name [OrderApp] like as shown below.
Now let’s build this application and run. Following is the snapshot after running application.
It is working fine. Now we have checked our application and its working fine now let’s publish this Application. Before starting to publish our Application just Run Visual studio as Administrator like as shown below.
To publish application just right click on Project name [OrderApp] and a List of options will appear from that List select [Publish] options like as shown below
After selecting Publish option a new dialog will pop up with name Publish Web like as shown below.
In this dialog it will first ask you to create a profile. If you have created profile already then you can select profile from Manage profile just click on Manage profile button a new small dialog box of Edit Web Publish Profiles will appear in that you can see your already created Profile.
If you had proper look on Publish Web dialog box you will also find Import button. After clicking on Import button below dialog will appear in this dialog you can Import profile from Azure Website or you can Import from Publish profile file.
We are new to publish this application hence we are going to create a New Profile.
To create a New Profile just select [Select or Import a publish profile] dropdown after selecting a [New Profile] item will appear in dropdown list just select that.
After selecting a New Profile, a new dialog box will appear with name [New Profile] asking to enter Profile name.
Here we entered profile name as [OrderApp_FTP] you can enter profile name of your choice.
After entering profile name just click on OK button then this process will move forward to next stage Connection setting.
Now we are going to select a way to publish our application for that we need to move to second step connection and in Publish method we need to select "FTP".
To use "FTP" for publishing website we need to enter credentials of FTP provided by FTP hosting space like as shown below
After entering all the details click on Next button to Move Forward to next stage of deployment process.
In this Process it will ask for selecting Configuration we have 2 options for this
Here we are going to select Release mode.
File Publish options section
After Selecting Configuration we have File Publish options those like as shown below.
This FTP publish method do not support Database publishing. After setting Configuration Click on Next button to Move Forward to next stage of deployment process.
In this preview we will not get a chance to view files which are getting published using FTP method. Following is the snapshot of preview dialog window.
After clicking on Publish button this site will get published to FTP hosting space which we have provided.
After completion of publishing you can check your location on FTP where you have uploaded files. Finally we have completed publishing application Using FTP.