This sample is designed to help developers with a simple (manual) development loop using Visual Studio Code. Many developers do not have access to a full Visual Studio license in order to use Microsoft's Dynamics CRM Development Toolkit. This sample solution is designed to get you started.
If you are reading this file on a VM Deployed from CloudSmith's project template system, these actions are completed.
- Download and install the CRM SDK into
C:\Deploy\CRMSDK
You can initiate the download and install automatically by running
.\Install-Sdk.ps1
in theCloudSmith.Dynamics365.SampleScripts
project. This installation will automatically rename and restructure SDK folders into logical groups.
- Download and install
Microsoft.Xrm.Data.PowerShell
You can initiate the download and install by running Install-Module Microsoft.Xrm.Data.PowerShell from a PowerShell prompt.
- Generated
XrmEntities.cs
for use in testing/applications viaCrmSvcUtil
You can initiate the download and install by running Install-Module Microsoft.Xrm.Data.PowerShell from a PowerShell prompt.
There are 2 "projects" with several components inside this toolkit. Inside each project are a number of files, described below:
What is it?
Service Utility extensions for CrmSvcUtil.exe that make it much more useful. You can read about it here.
What is it?
PowerShell scripts that handle the basic development loop of managing a CRM solution in Visual Studio Code.
File | Purpose |
---|---|
Deploy-XrmSolution.ps1 |
Deploys a CRM Solution from the local filesystem to the server |
Generate-XrmEntities.ps1 |
Generates a new XrmEntities.cs file for use in .Net applications |
Get-XrmSolution.ps1 |
Obtains a CRM Solution from the server and extracts it into the filesystem |
Install-Sdk.ps1 |
Installs the Dynamics CRM SDK into a specified folder on the filesystem. |
Install-XrmToolbox.ps1 |
Installs the open-source XrmToolbox solution on the filesystem. |
runonce-script.ps1 |
Script initializes VSCode and all needed pre-requisites to use this toolkit. |
Setup-EasyRepro.ps1 |
Configures Internet Explorer security settings so that EasyRepro can be used with IE for On-Premises deployments. |
vscode-extensions.txt |
A list of VSCode extensions that enable or ease development tasks related to Dynamics development. |
What is it?
Microsoft Unit Tests (MSTest) related to some commonly required tasks for Dynamics 365 Developers.
File | Purpose |
---|---|
DataGenerationTests.cs |
Contains several examples of generating sets of data (static and dynamic) for use in Dynamics 365. The dynamic test data generation is done with Bogus. |
InteractiveBrowserTests.cs |
Contains test samples of using EasyRepro with Dynamics 365 (version 8.2 is packaged by default, but can be updated) |
- Open
Install-Sdk.ps1
. - Modify the destination folder (if desired)
- Run the script.
- Open the
Generate-XrmEntities.ps1
file fromCloudSmith.Dynamics365.SampleScripts
. - Change the target path (if desired) on line 15.
- Run the script.
- Open the
Get-XrmSolution.ps1
file fromCloudSmith.Dynamics365.SampleScripts
. - Change the solution name that you want to get on line 2.
- Change the server and organization name on line 15.
- Change the destination path on line 36.
- Run the script.
- Execute a
git push
to commit the changes to source control.
- Open the
Deploy-XrmSolution.ps1
file fromCloudSmith.Dynamics365.SampleScripts
. - Change the solution name that you want to get on line 2.
- Change the server and organization name on line 15.
- Change the destination path on line 36.
- Run the script.
- Run the
Setup-EasyRepro.ps1
file fromCloudSmith.Dynamics365.SampleScripts
(only needs to be done once). - Update line 10 of
InteractiveBrowserTests.cs
fromCloudSmith.Dynamics365.SampleTests
with the URL of your Dynamics 365 environment. - Open Test Explorer in VSCode (an add-on specified in
vscode-extensions.txt
) using the "test" icon. - Expand the test tree under
InteractiveBrowserTests
. - Press the run button next to either
OpenAccountsGrid
orSwitchDashboard
.
- Update line 13 of
DataGenerationTests.cs
fromCloudSmith.Dynamics365.SampleTests
with the credentials of your Dynamics 365 environment. - Open Test Explorer in VSCode (an add-on specified in
vscode-extensions.txt
) using the "test" icon. - Expand the test tree under
DataGenerationTests
. - Press the run button next to either
GenerateRandomAccounts
orGenerateRandomAccountsWithContacts
.