Exercise 1: Creating a new module

anderslaub edited this page Dec 13, 2016 · 3 revisions

Exercise 1

In this exercise we will create a new feature module in Visual Studio

Creating a new Feature Module

The following steps are required for creating the Events module in Visual studio:

  1. Open a Windows File Explorer and navigate to c:/projects/sitecore.demo.group
    1. Create the following folder structure: /src/Feature/Events
  2. Open Visual Studio 2015
    1. Open the Habitat Group website solution from c:/projects/sitecore.demo.group
    2. Create a Solution folder in the root named “Feature”
    3. Create a Solution folder in “Feature” named “Events”
  3. Create a new Visual Studio Project in the “Events” folder:
    1. Use the “ASP.NET Web Application” template
    2. Location should be “C:\Projects\Sitecore.Demo.Group\src\Feature\Events”
    3. Name should be “code” as this will create the correct folder structure
    4. Under “ASP.NET 4.5”, choose the “Empty” template and check the “MVC folders” checkbox
  4. Set the properties for the new project
    1. Rename the project to “Sitecore.Feature.Events”
    2. In the project properties set the assembly name and namespace to “Sitecore.Feature.Events”
    3. Update the project to ASP.NET 4.6
    4. Delete the App_Data, App_Start and Global.asax files and folders
  5. The web.config to not be published with the project
    1. Open properties for the web.config and /views/web.config files
    2. Set “Build Action” to “None”
  6. Add configuration files
    1. Under the App_Config/Include create the “Feature” folder
  7. Add Sitecore Kernel NuGet reference
    1. Right-click the project and select "Manage NuGet Packages"
    2. Change package source to the Sitecore NuGet feed
      1. See https://doc.sitecore.net/sitecore_experience_platform/developing/developing_with_sitecore/sitecore_public_nuget_packages_faq
    3. Click Browse
    4. Find and install Sitecore.Kernel.NoReferences version 8.2.160729
    5. Find and install Sitecore.Mvc.NoReferences version 8.2.160729
  8. Set publish options
    1. Copy the “/Properties/PublishProfiles” folder from the Project/Sitecore.Demo.Group project
  9. Publish the project
    1. Save the Visual Studio solution
    2. In the Task Runner window, run “Publish all Projects”