Compartilhar via


CrmSvcUtil.exe extension usage and command-line parameters (Dynamics CRM 2013)

 

Applies To: Dynamics CRM 2013

Developer Extensions for Microsoft Dynamics CRM 2013 provides an extension to the CrmSvcUtil.exe command-line tool, called the Microsoft.Xrm.Client.CodeGeneration extension, which you can use to generate the data context and data transfer object classes for your Microsoft Dynamics CRM organization.

In This Topic

Use the code generation tool with extensions

Command line parameters

Use the generated class files

Use the code generation tool with extensions

To use the code generation tool with Developer Extensions for Microsoft Dynamics CRM, you specify the codeCustomization parameter as follows:

CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization,Microsoft.Xrm.Client.CodeGeneration" 
/url:https://crm-org-name.crm.dynamics.com/org-id 
/username:user-wlid-email 
/password:user-wlid-pwd 
/deviceid:user-defined-deviceid 
/devicepassword:user-defined-devicepwd" /out:"Xrm.cs" /namespace:Xrm

The code customization class is in Microsoft.Xrm.Client.CodeGeneration.dll, and since /codeCustomization takes a type name, CrmSvcUtil needs to be able to find the assembly, which is in the same folder as the tool.

Command line parameters

The following table lists valid command line parameters for the extensions to CrmSvcUtil.exe.

Parameter

Shortcut

Description

Required

deviceid

di

Device ID used when you connect to the online server for authentication.

False

devicepassword

dp

Device password that is used when you connect to the online server for authentication.

False

domain

d

The domain to authenticate against when you connect to the server.

False

url

The URL for the Organization service.

True

out

o

The file name for the generated code.

True

language

l

The language to generate the code in. This can be either '”CS” or ”VB”. Default value is ”CS”.

False

namespace

n

The namespace for the generated code. Default namespace is the global namespace.

False

username

u

The user name to use when you connect to the server for authentication.

False

password

p

The password to use when you connect to the server for authentication.

False

servicecontextname

The name of the generated organization service context class. If no value is supplied, no service context is created.

False

help

?

Show usage information.

False

nologo

Suppress the banner at runtime.

False

Use the generated class files

The classes that are output by the CrmSvcUtil.exe code generation tool are designed to be built into a class library that can be referenced by your projects that use pn_microsoftcrm. This is the recommended approach. After you have generated classes for your organization using CrmSvcUtil.exe, you should move the files to the folder for your Microsoft Visual Studio project and then add them to your solution.

To work with the classes you will also need a reference to Microsoft Dynamics CRM and .NET assemblies. The following table lists the assemblies and assembly locations.

Add references to these assemblies

Assembly location

Microsoft.Xrm.Sdk.dll

From the SDK\Bin folder.

Microsoft.Xrm.Client

Microsoft.Xrm.Portal

From the SDK\Bin folder.

System

System.Core

System.Data.Services

System.Data.Services.Client

System.Runtime.Serialization

From the .NET tab.

See Also

Generate code with the code generation tool extensions (Dynamics CRM 2013)
Create early bound entity classes with the code generation tool (CrmSvcUtil.exe)