Integrating Visual Studio solution with Sitecore MVC - basic

- Pranay on Apr 23 '16 at 05:40
- viewed 2764 times

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!



About the author

Pranay
Sitecore Certified Professional

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



Leave your comments on this post here