Lets Learn How to create an MVC 5 Application to store the data and how to publish and browse the application from IIS Manager.
This article gives the walk through on how to host the MVC 5 App in IIS Express and store the data and information in the database created in SQL Server. Visual Studio uses the ASP.NET Development Server as a default and here in this article IIS Server is used to host a MVC 5 App. As we are aware that, in Visual Studio 2013 RC the ASP.NET Web Application uses a MVC5 project template and MVC5 uses the Bootstrap theme to display the application, Visual Studio 2013 RC is being used to develop an application using the MVC project template.
Let's start to develop an application in MVC 5 using the following steps.
- Step 1 Create a New Project Open visual studio 2013 RC -> click on File -> New Project -> Create new ASP.NET WebApplication -> Name it as IISDemo.
- Step 2 select MVC Project Template as shown below
- Step 3 Now Open Web.config file and change the default Connection string of the database with your database Credentials as shown
<add name="DefaultConnection" connectionString="Data Source=RAMASAGAR-PC;Initial Catalog=IISDemo;Persist Security Info=True;User ID=sa;Password=sagar@533" providerName="System.Data.SqlClient" />
Here i have provided the Datasource and database name as IISDemo
- Step 4 Now lets Debug the Application and click on Register
- Step 5 Now Lets Check our Database. we will find Database IISDemo is created automatically with all the roles and member ship
- Step 6 Now Lets Publish the Application
Right Click on Solution Explorer-> Select Publish
- Step 7 Now Select New Profile and click on Next as shown
- Step 8 Create a new Profile as shown below
- Step 9 Select File System in Publish and select location in the Target Folder.
- Step 8 Select Release and click Next
- Step 10 Now we can see that the application is published successfully
Now Lets Learn IIS HOST
Open Internet Information Services (IIS) Manager by typing "inetmgr" command through Run and select the Project from Default site
Right Click on the project-->Select Convert to Application-->Click on OK in the Next Window
Click on Advanced Settings
By Default Application Pool is DefaultApppool click on it and change to Asp.net 4.0 as shown
Now Click on Browse we can watch the Following output
So far we have learned on how to Host and Publish MVC5 Application..Let me know any issues with your comments.Thanks for reading the article.
In case you are looking for trusted hosting provider, we trust on this and this.