-
Notifications
You must be signed in to change notification settings - Fork 11
Setup
-
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.
- Microsoft.Xrm.Data.PowerShell - Microsoft.Xrm.Data.PowerShell GitHub project - PowerShell wrapper for CRM SDK CrmServiceClient class.
- Microsoft.CrmSdk.CoreTools - Microsoft.CrmSdk.CoreTools Nuget package - Offical Microsoft CRM SDK core tools
- CreateNewNuGetPackageFromProjectAfterEachBuild - CreateNewNuGetPackageFromProjectAfterEachBuild Nuget package - helper package to build nuget packages
-
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
-
Configuration
After the Nuget package is installed, two configuration files will be added to the root of the project; CrmConfiguration.props and MappingFile.xml.-
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 -
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.
-