Published using Google Docs
Publishing MVC 4 Projects To Web Server
Updated automatically every 5 minutes

Publishing MVC 4 Projects To Web Server

1) Download Sample Project Website

http://code.msdn.microsoft.com/Intro-to-ASPNET-MVC-4-61d0219d 

Download the Sample Code

2) Unzip to your projects folder.

3) Run Visual Studio 2010 and open the project.

4) Check connection strings in Web.config file

Initial codes…

<connectionStrings>

    <add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-MvcMovie-20120730162622;Integrated Security=SSPI" providerName="System.Data.SqlClient" />

    <add name="MovieDBContext" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Movies.mdf;Integrated Security=True"

   providerName="System.Data.SqlClient" />

  </connectionStrings>

Change to … (Copy connectionString for DefaultConnection, paste to MovieDBContext and rename the Initial Catalog to Movies)

<connectionStrings>

    <add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-MvcMovie-20120730162622;Integrated Security=SSPI" providerName="System.Data.SqlClient" />

    <add name="MovieDBContext"   connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-MvcMovie-20120730162622;Integrated Security=SSPI" providerName="System.Data.SqlClient" />

  </connectionStrings>

5) Run the project

6) Register

Username: user1

Password: password123!

7) Stop Project Execution

8) Publish to your Web Server