Context

When you work on a new plugin, you need to deploy it multiple time to get the expected behavior regarding customer need. But, using Registration Tool multiple time per day represent an optimisable workload considering manual operations and also the risk of human error. So I have made a little script that scan the binaries folder in output of Visual Studio compilation and update the existing CRM assemblies.

Prerequisites

The script couldn’t run properly without the following criterias:

CRM user specified in configuration file need to be system administrator (update assembly)

You should provide an Assembliesfolder that contains

CRM SDK assemblies :

Microsoft.Xrm.Sdk.dll

Microsoft.Xrm.Client.dll

Microsoft.Crm.Sdk.Proxy.dll

Script must be run with elevated privilèges

Process

Scan assembly folder given in parameter

Check if assembly need to be updated (regarding configuration : name and configuration)

Update assembly

Deploy debug symbols (pdb) to configured folder

Configuration

The script use a configuration.xml file that provide the following parameters :

Context

A common problematic encountered in complex development projects is to handle CRM customizations in the same way that we manage other sources (plugin classes, javascript webresources, …). Source control integration provides the following advantages:

Backup : Capability to restore all your CRM customizations

Versioning : Capability to get a previous version

Comparison : Capability to visualize différences

History : Capability to track modifications

3 years ago, I’ve worked with Tanguy Touzard on a batch that call differents applications in order to store a CRM solution to the TFS Source Control. And, recently, I‘ve decided to rewritte it in order to optimize the process, minimize external applications dependencies and invoke CRM and TFS apis directly from Powershell.

You could also run it with Azure Automation or a TFS build, but you need to host the TFS and CRM SDK assemblies in a centralized storage.

Have fun!

]]>https://blogs.msdn.microsoft.com/aymerics_blog/2015/06/06/synchronize-dynamics-crm-customizations-to-tfs-source-control/feed/0CRM Data Management With PowerShellhttps://blogs.msdn.microsoft.com/aymerics_blog/2014/06/28/crm-data-management-with-powershell/
https://blogs.msdn.microsoft.com/aymerics_blog/2014/06/28/crm-data-management-with-powershell/#commentsSat, 28 Jun 2014 01:00:00 +0000https://blogs.msdn.microsoft.com/aymerics_blog/2014/06/28/crm-data-management-with-powershell/As you know, it is not supported to manipulate CRM data with SQL, you need to use CRM WebServices with CRM SDK.

You can write console applications that handle data operation but it is not very flexible for quick operations.

PowerShell is a great solution for multiple reasons :

You can edit and run script on windows server

No compilation

Well documented

Can execute .NET code

OK, that was the boring theory introduction, let's go with code examples !

Load SDK assemblies

In order to have access to CRM classes, you need to load CRM SDK assemblies to Powershell script :

This will return account record with requested accountnumber given in method parameter.

Process results

When you retrieve a collection of record from Get-Multiple-Records method, you can process results with a simple foreach instruction. In order to display process progression, you can use Write-Progress snippet.

I have serialization problem on record create / update when giving an OptionSetValue to record attribute with the following error :

«The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.microsoft.com/xrm/2011/Contracts/Services:entity. The InnerException message was 'Error in line 1 position 11940. Element 'http://schemas.datacontract.org/2004/07/System.Collections.Generic:value' contains data from a type that maps to the name 'System.Management.Automation:PSObject'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'PSObject' and namespace 'System.Management.Automation'.'. Please see InnerException for more details.»

This error is link to Powershell conversion of object that is not understand by CRM WebService.

]]>https://blogs.msdn.microsoft.com/aymerics_blog/2013/06/27/tool-release-crm-solution-commandline-helper/feed/0Scripting : Toggle proxy server in IE settings with PowerShellhttps://blogs.msdn.microsoft.com/aymerics_blog/2013/05/18/scripting-toggle-proxy-server-in-ie-settings-with-powershell/
https://blogs.msdn.microsoft.com/aymerics_blog/2013/05/18/scripting-toggle-proxy-server-in-ie-settings-with-powershell/#commentsSat, 18 May 2013 00:43:37 +0000https://blogs.msdn.microsoft.com/aymerics_blog/2013/05/18/scripting-toggle-proxy-server-in-ie-settings-with-powershell/My current Customer use a proxy server for Internet and I need to change this settings each morning (when I start to work for him) and each evening (when I return at home). To save precious time, I wrote a little script that toggle this setting at each script execution :

This document provides interesting information about methodologies and processes to handle solution development, deployment and test during enterprise scenarios.

Moreover, this document describes how to integrate CRM solution package into Visual Studio (and also into TFS source control) with Solution Packager. This step is the key to facilitate versionning and branches management.

]]>https://blogs.msdn.microsoft.com/aymerics_blog/2013/05/16/new-microsoft-release-alm-for-microsoft-dynamics-crm-2011-crm-solution-lifecycle-management/feed/0Dynamics CRM error : The specified module could not be found (Win32Exception)https://blogs.msdn.microsoft.com/aymerics_blog/2013/05/15/dynamics-crm-error-the-specified-module-could-not-be-found-win32exception/
https://blogs.msdn.microsoft.com/aymerics_blog/2013/05/15/dynamics-crm-error-the-specified-module-could-not-be-found-win32exception/#commentsWed, 15 May 2013 09:25:44 +0000https://blogs.msdn.microsoft.com/aymerics_blog/2013/05/15/dynamics-crm-error-the-specified-module-could-not-be-found-win32exception/Recently I have encountered the following error during CRM web application load :

An unhandled exception has occurred

Exception type: Win32Exception Exception message: The specified module could not be found.

]]>https://blogs.msdn.microsoft.com/aymerics_blog/2013/05/15/dynamics-crm-error-the-specified-module-could-not-be-found-win32exception/feed/2Media File Managerhttps://blogs.msdn.microsoft.com/aymerics_blog/2013/05/01/media-file-manager/
https://blogs.msdn.microsoft.com/aymerics_blog/2013/05/01/media-file-manager/#respondWed, 01 May 2013 12:01:00 +0000https://blogs.msdn.microsoft.com/aymerics_blog/2013/05/01/media-file-manager/OK, here's the scenario : you have a lot of pictures and videos and it takes a lot of disk space. If you want to organize and compress them, you will apreciate this tool.

Media File Manager processes given directory arborescence to find pictures and video. It take the file creation date according to metadata to give an appropriate name. Then it compresses and resizes pictures with high quality respect.

Warning : This tool is perfect for my exigences. Be aware that it will loose quality on HD pictures.