Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is null issue

Posted on by Microsoft Employee

Hi All,

Greetings.

I have the issue in my C# console application when i try to connect dynamics 365 online trial version. The issue is,

"Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is nullOrganizationServiceProxy is nullOrganizationServiceProxy is nullOrganizationServiceProxy is nullOrganizationServiceProxy is nullOrganizationServiceProxy is nullOrganizationServiceProxy is nullOrganizationServiceProxy is null".

C# Line: CrmServiceClient conn = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(connectionString);

please find the C# code below,

namespace RetriveRecords_CRM365Online
{
class Program
{
static void Main(string[] args)
{
string connectionString = ConfigurationManager.ConnectionStrings["Server=CRM Online, organization=contoso, user=someone"].ConnectionString;

if (connectionString != null)
{
CrmServiceClient conn = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(connectionString);
IOrganizationService _orgService = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;

}
}
}
}

App.config file is,

<connectionStrings>
<add name="Server=CRM Online, organization=contoso, user=someone" connectionString="Url=https://******3.api.crm8.dynamics.com; Username=*********.com; Password=*******; authtype=Office365;" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>

SDK and Tooling connector versions,

Microsoft.Crm.Sdk.Proxy is 9.0.0.0

Microsoft.Xrm.Sdk is 9.0.0.0

Microsoft.Xrm.Sdk.Deployment is 9.0.0.0

Microsoft.Xrm.Sdk.Workflow is 9.0.0.0

Microsoft.Xrm.Tooling.Connector is 3.0.0.0

Microsoft.IdentityModel.Clients.ActiveDirectory is 2.22.0.0

Please help me to fix this issue. I have read different posts and tried the same but still this issue exists.

*This post is locked for comments

  • Suggested answer
    Justinjose Profile Picture
    Justinjose 2,707 on at
    RE: Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is null issue

    Hi Sathesh,

    This might be TLS1.2 issue. Please add following highlighted code before calling IOrganizationService.

    class Program
        {
            private static IOrganizationService _orgService;
            static void Main(string[] args)
            {
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; CrmServiceClient GetCrmServiceClient = new CrmServiceClient(@"AuthType=Office365;Username=xxxxx; Password=xxxxxx;Url=xxxxxxx.com"); _orgService = (IOrganizationService)GetCrmServiceClient.OrganizationWebProxyClient != null ? (IOrganizationService)GetCrmServiceClient.OrganizationWebProxyClient : (IOrganizationService)GetCrmServiceClient.OrganizationServiceProxy; var userRequest = new WhoAmIRequest(); var userResponse = (WhoAmIResponse)_orgService.Execute(userRequest); Guid currentUserId = userResponse.UserId; Console.WriteLine(currentUserId); Console.ReadLine(); } }

    Thanks

    Justin Jose

  • Suggested answer
    Friyank Profile Picture
    Friyank 944 on at
    RE: Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is null issue

    This is not any Microsoft Bug.

    This is because,

    CRM 365 9.0 connection  is only possible using TLS 1.2

    Hope this blog here helps you

    coderscollection.wordpress.com/.../607

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is null issue

    Hi all,

    Refer the below link to solve the connection problem with Dynamics 365 online,

    arunpotti.wordpress.com/.../step-by-step-to-connect-dynamics-365-crm-online-v9-x-using-c-console-application

    Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is null issue

    I had similar issue, updated the url to use the org name. so Url=contoso.api.crm.dynamics.com/.../v9.0  "check the version but should be in dev resources the exact url"

  • speedracer0101 Profile Picture
    speedracer0101 10 on at
    RE: Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is null issue

    I am having the same issue, any luck?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is null issue

    Thanks preeti, i will try this

  • Suggested answer
    Preeti Sharma Profile Picture
    Preeti Sharma 2,678 on at
    RE: Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is null issue

    Hi,

    Please make sure you are using latest SDK as well as try changing .net framework to 4.6 version.

    Hope this helps:)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is null issue

    Hi Radu, I tried the same but no differences. I am always welcome, any other suggestions from you.

    Thanks

    Sathesh

  • Suggested answer
    Radu Chiribelea Profile Picture
    Radu Chiribelea 6,667 on at
    RE: Unable to Login to Dynamics CRMOrganizationServiceProxy is nullOrganizationServiceProxy is null issue

    Hi Satesh,

    For the URL parameter can you please try to specify the URL you use in the browser to connect (crmorg.crm8.dynamics.com) instead of the API one? Does that make a difference?

    Regards,

    Radu

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans