5
votes

I am trying to generate early bound entity classes from my Dynamics CRM Online instance.

I have CRM SDK installed on my machine.

I am running following command from the "Bin" folder of SDK.

crmsvcutil.exe /url:<<OrganizationServiceUrl>> /out:crmexams3.cs /username:"<<username>>" /password:"<<password>>"

But this gives me following error:

Error requesting orgs from the discovery server
Access is denied

I have replaced the OrganizationServiceUrl with the organization service url which I could found from Developer resources in CRM instance.

My instance is CRM 2016 Online.

Any idea why this is failing?

Thanks

2

2 Answers

5
votes

If you put /il as an argument and remove the username and password you can enter the credentials, domain, etc through a XRMTooling Login Control. Entering it in manually has the benefits of:

  • It will potentially fix your problem.
  • It makes it so you aren't storing credentials somewhere, which is a little bit of a security faux paux.
0
votes

Access is denied suggests you have the wrong user name and password provided.

There are examples of how the command line should look here, perhaps your username is in the wrong format?

The first example is for the Microsoft account identity provider and the second is for the Office 365 identity provider.

CrmSvcUtil.exe /url:https://myorg.api.crm.dynamics.com/XRMServices/2011/Organization.svc    /out:GeneratedCode.cs /username:"[email protected]" /password:"myp@ssword!" 

CrmSvcUtil.exe /url:https://myorg.api.crm.dynamics.com/XRMServices/2011/Organization.svc    /out:GeneratedCode.cs /username:"[email protected]" /password:"myp@ssword!"