2
votes

CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization,Microsoft.Xrm.Client.CodeGeneration" /out:Xrm \Xrm.cs /url:https://mycrm.crm4.dynamics.com/XRMServices/2011/Organization.svc /username:name /password:pass /namespace:Xrm /serviceContextName:XrmServiceContext

If I run the above command, I get the following error:

Exiting program with exception: Value cannot be null. Parameter name: identityProvider

Its a dynamic crm online environment.

4
You got a space in name space:Xrm, it should be namespace:Xrm. this might not be the reason for above error. But its wrong. - Scorpion
thx, corrected the question. It was correct in the command though. - Demian Kasier
I do not know why i was getting error, its said error parameter detail. But when i changed to namaspace:Xmr it works... Thanks any way, @DemianKasier - Bruno Gomes

4 Answers

5
votes

Just use this: https://xrmearlyboundgenerator.codeplex.com/ If it's missing a feature, let me know. It'll spit out the correct command line parameters.

1
votes

I've had the same problem - in my case, there was a trailing space on the end of the username in my CrmSvcUtil.exe.config file.

This:

<add key="username" value="[email protected]" />

works fine, but this:

<add key="username" value="[email protected] " />

caused the error:

Exiting program with exception: Value cannot be null.

Parameter name: identityProvider

0
votes

Please try the following:

don't forget to update the username and password.

CrmSvcUtil.exe /url:https://mycrm.crm4.dynamics.com/XRMServices/2011/Organization.svc
/out:Xrm.cs /username:<username> /password:<password>
/namespace:Xrm /serviceContextName:XrmServiceContext

0
votes

I was able to correct this by changing my username.

We use a single sign-on service. When I log into the CRM in the browser, I am taken to https://login.microsoftonline.com. There, I select my email address. Then the browser is directed to https://sso.mydomain.com. From here, I log in with my email address and regular network password. Then I am connected to the CRM in my browser.

When I change the /username parameter to my email address that I use to log into the CRM, instead of my regular username, the problem disappears.