Learn IIS Host and Publish in MVC5 using Visual Studio 2013 RC

Rama Sagar
Posted by in ASP.NET MVC category on for Beginner level | Points: 250 | Views : 17925 red flag

Lets Learn How to create an MVC 5 Application to store the data and how to publish and browse the application from IIS Manager.

Introduction


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
        
  <connectionStrings>
    <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" />
</connectionStrings>
     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 9 Click on Publish 



  •   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

  

Conclusion


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.


Page copy protected against web site content infringement by Copyscape

About the Author

Rama Sagar
Full Name: RamaSagar Pulidindi
Member Level: Silver
Member Status: Member,MVP
Member Since: 12/30/2012 1:51:40 AM
Country: India
ramasagar
http://www.ramasagar.com
A Software Profesional working in Microsoft .NET technologies since year 2008, and I work for Dake ACE. I am passionate about .NET technology and love to contribute to the .NET community at Dot Net Funda

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)