Skip to content

Installation

Luke Benting edited this page Apr 10, 2019 · 1 revision

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 given any names, but a suggested name for project is [Namespace].CrmSource.csproj.
  • Minimum .NET Framework: 4.5.1

Dependencies

Installation 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
  • OR

    • Run the command line Install-Package MSBuild.Xrm.SourceControl in the 'Package Manager Console'.

    NOTE: By default, the MSBuild.Xrm.SourceControl package has a dependency on v8.2.0.5 of Microsoft.CrmSdk.CoreTools, this is to maximise compatability. If your Dynamics 365 instance is on a later version, we recommend that you update to the latest version of Microsoft.CrmSdk.CoreTools through the 'Manage NuGet Packages' window.

  1. 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 Calendar 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