Can't run QuickStart WinForms sample, please help! RRS feed

  • Question

  • Hi,

    I am new to Microsoft Dynamic CRM and I am doing research on the SDK. I got my login ID and password and I can login into online Office 365 and play with the CRM module. Now I tried to use the sample code QuickStart WinForm with my login ID, but seems I am blocked. I changed the app.config with my own email address and real password and run the app, the program stopped at this code: Guid userid = ((WhoAmIResponse)_orgService.Execute(new WhoAmIRequest())).UserId; which seems to retrieve my account profile method. I believe I am connected as the sample app prints "connected". But the problem is I am stopped at this point. The program captured an exception which was "Access denied"

    Here is my user setting and license status:

    Assign role: Global administrator

    Set sign-in status: Allowed

    Assign licenses checked:

    Microsoft Dynamic CRM Online intenral user rights(IUR) benefit for MPN members and Office 365 Enterprise E3

    Any idea or suggestion ?



    Tuesday, June 2, 2015 8:37 PM

All replies

  • Zhang,

    Does your account have the 'System Administrator' or 'System Customizer' Role?

    Kind Regards

    Wednesday, June 3, 2015 6:58 AM
    • Are you using the correct version of the SDK (if online should be crm 2015)?
    • Does your user have access into the CRM system itself?
    • If you debug the code where the connection is created(OrganizationServiceProxy object) , does it go through the correct connection code (online).

    Halldór Jóhannsson

    Wednesday, June 3, 2015 12:36 PM
  • Yes, as I listed in my original post, I am global administrator. I guess it is the highest one, right?
    Wednesday, June 3, 2015 3:28 PM
  • In CRM it is System Administrator, a security role that your user should have, I was just wondering if you were looking at your user in the managament page for microsoft online service portal (where you can manage your CRM system, Sharepoint system, Office system etc) but not the CRM system itself. I am not entirely familiar with the management part in the microsoft online services portal so when you say global administrator it sounds like you are talking about that part but not CRM?

    Halldór Jóhannsson

    Wednesday, June 3, 2015 3:39 PM
  • Hi Halldor.

    The online site i guess it is crm 2015, here is the login URL https://login.microsoftonline.com/. The SDK version is runtime version v4.0.30319 and DLL version is get this from the DLL reference properties window inside visual studio), 

    My login ID is set as global system administrator and system customizer and I can login into the online CRM and seems i can do whatever I want.

    I don't find the OrganizationServiceProxy object in the SDK sample code, i am playing with the QuickStart using WinForms sample projects. Inside this sample code, it is using CrmConnection object which i pass the connection string containing my email address and password, and then the OrganizationService object with CrmConnection object as its parameter. Once it tries to execute WhoAmIRequest then the code throw an exception saying Access Denied.

    Here is the code throw the exception

    Guid userid = ((WhoAmIResponse)_orgService.Execute(new WhoAmIRequest())).UserId;

    Any idea?


    • Edited by Zhang Lan Wednesday, June 3, 2015 3:54 PM
    Wednesday, June 3, 2015 3:54 PM
  • If you are online then your CRM version is 2015, so you would need a SDK version to match.

    And your error is basically saying that you do not have access to query the CRM.

    When you configured the app.config, did you use the Office 365 connection string?

    Halldór Jóhannsson

    Wednesday, June 3, 2015 4:57 PM
  • Hi All,

    I figured out the reason. I was using the default URL which is not correct. I have to use my own company one which something like xxx..crm.dynamics.com. not the default one. Now I am able to connect and run that command.

    Thanks all your help.


    Wednesday, June 3, 2015 5:38 PM
  • Thats good to hear 8)

    Halldór Jóhannsson

    Wednesday, June 3, 2015 5:42 PM