Skip to content
Kevin Lee edited this page Apr 8, 2019 · 7 revisions

Setup

Prerequisites

  • Powershell 4.0+
    The Powershell scripts that are executed as part of these extensions require Powershell 4.0 or later.
  • Solution and Class Library Project created in Visual Studio
    Solution and Project can be named anything, but a suggested name for project is [Namespace].CrmSource.csproj.

Dependencies

Setup Steps

  1. Add Nuget Package to 'CrmSource' Project
    For simplicity, the extensions are installed via a nuget package. The nuget package is on nuget.org which is a default package source in Visual Studio.

    • Right click the project -> Manage NuGet Packages
    • Install MSBuild.Xrm.SourceControl
  2. Configuration
    After the Nuget package is installed, two configuration files will be added to the root of the project; CrmConfiguration.props and MappingFile.xml.

    1. CrmConfiguration.props
      This file is used to configure the connection to the Dynamics instance. The default file should look like this:

      <?xml version="1.0" encoding="utf-8"?>
      <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
        <PropertyGroup>
          <CrmSolutionName>NOT_DEFINED</CrmSolutionName>
          <CrmConnectionString>Url=url; Username=user; Password=password; AuthType=Office365;</CrmConnectionString>
          <ExportAutoNumberSettings>0</ExportAutoNumberSettings>
          <ExportCallendarSettings>0</ExportCallendarSettings>
        </PropertyGroup>
      </Project>

      The following elements must be updated:

      CrmSolutionName: The Name of the Dynamics Solution
      CrmConnectionString: The connection string that will be used to connect to the Dynamics instance, more information can be found here.
      ExportAutoNumberSettings: Option for whether to Export the AutoNumber Settings for the Solution, 0 for No, 1 for Yes
      ExportCallendarSettings: Option for whether to Export the Callendar Settings for the Solution, 0 for No, 1 for Yes

    2. MappingFile.xml
      This configuration is used when the solution zip file is being recompiled from the extracted solution files. The mapping file can define mappings between a file that is contained in the dynamics solution and a file that is stored locally. Examples of files that would usually be desirable to map are Web Resources and Plugin/Custom Workflow Action .dll files. This ensures that the latest version of the files are used to rebuild the solution.

      The default file should look like this:

      <?xml version="1.0" encoding="utf-8"?>
      <Mapping>
      
      </Mapping>

      Example file:

      <?xml version="1.0" encoding="utf-8"?>
      <Mapping>
        <FileToPath map="WebResources\*.*" to="..\..\Capgemini.CrmPackage\WebResources\**" />
        <FileToPath map="WebResources\**\*.*" to="..\..\Capgemini.CrmPackage\WebResources\**" />
        <FileToFile map="Capgemini.Workflows.dll" to="..\..\Capgemini.Workflows\bin\**\Capgemini.Workflows.dll" />
        <FileToFile map="Capgemini.Plugins.dll" to="..\..\Capgemini.Plugins\bin\**\Capgemini.Plugins.dll" />
      </Mapping>

      More information on how to configure the MappingFile.xml can be found here.

Clone this wiki locally