5

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

jasonscript
  • 6,039
  • 3
  • 28
  • 43
Nirman
  • 6,715
  • 19
  • 72
  • 139

2 Answers2

6

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.
Brendon Colburn
  • 1,902
  • 1
  • 9
  • 10
0

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:"myname@live.com" /password:"myp@ssword!" 

CrmSvcUtil.exe /url:https://myorg.api.crm.dynamics.com/XRMServices/2011/Organization.svc    /out:GeneratedCode.cs /username:"myname@myorg.onmicrosoft.com" /password:"myp@ssword!"
James Wood
  • 17,286
  • 4
  • 46
  • 89
  • the possibility of incorrect user name and password is not there, as I use the same credentials to connect to crm instance which works fine there. I am using the same command and syntax as you have provided in the example. This seems to be some odd issue. I found more convenient mechanism that is to use "Early bound generator" plugin provided in Xrm Toolbox which does this job efficiently. – Nirman Aug 05 '16 at 05:00