Here we will learn step by step process to deploy or publish ASP.NET Web Application using File System option in visual studio. To publish and deploy application here we are going to use simple Web Application which we already created for deployment “Company_Management” like as shown below.
Publishing Application using Visual Studio
To publish application just right click on Project name “Company_Management” and a List of options will appear from that List select “Publish” options like as shown below:
Step 1 : Pick a Publish target and click on IIS,FTP,etc and Create Profile as shown below:
Step 2 : Select Publish Method “File System” , enter Target Location and Click Save as shown below:
Step 3 : Publish Your Web Application as shown below:
That’s all you need to do from Visual Studio for now!
Configuring IIS Server
Open IIS Manager and perform these steps to configure the IIS server.
Step 1: Right Click On Sites and add a new Site as shown below:
Now open your Visual Studio and run your Web Application and Write the port number that Web Application is currently using (can be found from url like http://localhost:53248).In my case it was 53248.It will vary for all of you make sure to put the right port number.
Step 2: Add Connection Strings to Connect Database as shown below:
Step 3 : Remove Already Present Connection Strings as shown below :
Step 4 : Add New Connection Strings as shown below :
Name : Connection Strings Name which can be found from Web.config file.
Server : Server Name which can be found through SSMS easily.
Database : Project database that you want to connect with it.
Credentials : Use Specify Credentials and unlock a user “sa” in SSMS(Sql Server Management Studio) by going in Security and Logins if it is not unlocked. Enter Credentials for “sa” user.
Step 5 : Start Your Web Application as shown below:
Step 6 : Browse Your Website and You’re good to go.
Congrats! You have successfully deployed your MVC Web Application on Local IIS Server.