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.
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.