Thursday, September 25, 2014

Publishing MVC 4 Projects To Web Server

---
Publishing MVC 4 Projects To Web Server

1) Download Sample Project Website

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

---

No comments:

Post a Comment