Creating a Sitecore Visual Studio Project Outside of the Web Root

Blog | Technical
Written By: Nabil OrfaliPublished On: Jul 05 2016

Assuming you have Sitecore Rocks and a Sitecore instance installed, creating the project outside of the web root should be a simple process:

  1. Create an Empty Web Application. In Visual Studio 2013, this can be done by selecting FILE -> New -> Project... and then selecting Templates -> Visual C# -> Web -> ASP.NET Web Application.
  2. Name the project, click OK, and select the Empty template.
  3. Delete the web.config file in the newly created project.
  4. Copy the web.config file from your Sitecore instance of your existing project.
  5. Create a new folder named App_Config in the new project.
  6. Copy the file ConnectionString.config from the App_Config folder located in your Sitecore instance to the App_Config folder you created in the new project.
  7. Create a new folder named lib in the new project.
  8. Copy the file Sitecore.Kernel.dll from the bin folder located in your Sitecore instance to the lib folder you created in the new project.
  9. Add a reference to the Sitecore.Kernel.dll in your project (which should be in the lib file).

Before proceeding, it is recommended that you build the project. 

The final step is to setup a publishing profile and publish:

  1. Select BUILD -> Publish {project name}
  2. In Profile, select from the dropdown and enter a profile name.
  3. In Connection, under target location, click on Local IIS and choose your Sitecore instance, or do it manually by navigating to the Sitecore instance folder. Make sure that the publish method is File System.
  4. In Settings, set the Configuration when Debug.
  5. Click Publish.

That should do it!

Your "out of web root" project should now be ready!

About the AuthorNabil Orfali
Nabil OrfaliCEO & Founder, Sitecore Strategy MVP