Integrating Visual Studio solution with Sitecore MVC - basic

Pranay
May 16, 2020  ·  17500 views

Sitecore is a .NET application and adding any new functionalities to it requires adding of .NET components to the Sitecore instance. So it is required to create a Visual studio solution and move the changes from visual studio to Sitecore instance as and when required.

Prerequisites:

  • Sitecore (I have used Sitecore 8 in this example)
  • Visual studio (Visual studio 2013) with Sitecore installed

Now just follow the below steps you will be able to create a VS solution for your Sitecore instance

  1. Open Visual studio and create an empty ‘ASP.NET Web Application’ as shown below.

    Image Text

    Image Text

  2. Copy Sitecore.MVC.dll, Sitecore.Kernel.dll files from your Sitecore instance bin folder to the bin folder of the visual studio and refer them in the solution.

    Image Text

    Image Text

  3. Delete the default Web.config file in the newly created VS solution and copy the Web.config file from the Sitecore instance to the VS solution.

  4. Rebuild solution, then right click on the project and select publish.

    Image Text

    Image Text

    Image Text

  5. Now let’s connect our solution to the Sitecore instance

    Image Text

    Image Text

  6. Everyone may or may not require the below step. Just make sure that you are seeing the success message finally.

    Image Text

    Image Text

    Image Text

  7. Now publish and make sure we dint break anything and the solution works fine.

  8. Once done, right click on the project, select Sitecore->properties and update the Sitecore instance connection properties.

With this, you are done with the creation of a visual studio solution for a Sitecore instance. Now you can start creating a sample page with a controller rendering Controller rendering in Sitecore MVC.

Creating a new page in Sitecore - Steps to create a new page

Hope it helps. Please comment your thoughts!

AUTHOR

Pranay

A Software Engineer by profession, a part time blogger and an enthusiast programmer. You can find more about me here.


Post a comment




Thank you! You are now subscribed.

Sign up for our newsletter

Subscribe to receive updates on our latest posts.

Thank you! You are now subscribed.