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
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
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
Hi all,
Refer the below link to solve the connection problem with Dynamics 365 online,
Thanks
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"
I am having the same issue, any luck?
Thanks preeti, i will try this
Hi,
Please make sure you are using latest SDK as well as try changing .net framework to 4.6 version.
Hope this helps:)
Hi Radu, I tried the same but no differences. I am always welcome, any other suggestions from you.
Thanks
Sathesh
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156