Extending CrmSvcUtil with filtering
As described in Creating early bound entity classes, CrmSvcUtil
is a great utility to generate early bound entities that improve your development productivity.
CrmSvcUtil
, as it is, generates all entities associated with a Dynamics 365 instance. The generated file is usually quite large and onerous to inspect. In this recipe, we will write a small extension to only generate early bound classes for custom entities that have a prefix of our choice, in this example, the packt_
prefix (our Dynamics 365 publisher prefix).
Getting ready
In order to create the extension, you will need an IDE such as Visual Studio with .NET 4.5.2, a reference to the Microsoft.CrmSdk.CoreAssemblies
NuGet package, and a reference to the CrmSvcUtil.exe
executable.
How to do it...
- Create a new Visual Studio solution called
Packt.Xrm
.CrmSvcUtilExensions
with a project of type class library. - Using the NuGet package manager, install the latest version of
Microsoft.CrmSdk.CoreAssemblies
that...