Notifications
Announcements
No record found.
Actually it work good upto yesterday, but today i could not connect below error occur
"Unable to Login to Dynamics CRMOrganizationServiceProxy is null"
*This post is locked for comments
Hi,
did you try the latest nuget package for Microsoft.CrmSdk.XrmTooling.CoreAssembly ?
It was released 12 days ago, though, not yesterday.. so not sure if that's the problem.. But, if your code stopped working suddenly, that's the first thing I would try:
www.nuget.org/.../9.0.0.5
Hi Alex,
Thanks for your reply , i try this one and update you
i tried this one , but error remains same
Maybe this, then.. the TLS 1.2 requirement is relatively new, I believe.. But your Dynamics instance may have been updated recently so it may be enforced now:
community.dynamics.com/.../unable-to-login-to-dynamics-crmorganizationserviceproxy-is-null
Hi Iswarya,
This might be TLS1.2 issue. Please add following highlighted code before calling IOrganizationService.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; CrmServiceClient crmSvc = new CrmServiceClient(ConfigurationManager.ConnectionStrings["online"].ConnectionString); IOrganizationService _orgService = crmSvc.OrganizationWebProxyClient != null ? crmSvc.OrganizationWebProxyClient : (IOrganizationService)crmSvc.OrganizationServiceProxy;
<connectionStrings> <add name="Online" connectionString="; Username=; Password=; authtype=Office365" /> </connectionStrings>
Thanks
Justin Jose
It generally happens when you are using tooling connector for connection to Dynamics 365 Online.
In order to resolve the issue you have to specify the security protocol before you make calls to your Microsoft.Xrm.Tooling assembly.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
The connection to Dynamics 365 will not be available unless TLS12 is being used as Security Protocol.connection.
Hope it helps.
BR,
Judy
-----------------------------------
Appreciate to Mark as Answer if it is useful.
This is my code , i already used this SecurityProtocol but error remain same
public class CRMService
{
public IOrganizationService _orgService;
public IOrganizationService CreateConnection(string un,string pw)
var conn = new CrmServiceClient(GetConnectionString(un, pw));
_orgService = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;
if (_orgService == null)
return null;
}
return _orgService;
private string GetConnectionString(string username, string password)
try
var connectionString = default(string);
string strOrgUrl = ConfigurationManager.AppSettings["OrganizationUri"].ToString();
connectionString = "RequireNewInstance=True; Url=" + strOrgUrl + "; Username=" + username + "; Password=" + password + "; AuthType=Office365;";
catch (Exception ex)
throw;
return connectionString;
finally
Hi Iswaraya,
can you add TLS1.2 code before calling CrmServiceClient. I have highlighted the changed section
public class CRMService { public IOrganizationService _orgService; public IOrganizationService CreateConnection(string un,string pw) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 var conn = new CrmServiceClient(GetConnectionString(un, pw)); _orgService = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy; if (_orgService == null) { return null; } return _orgService; } private string GetConnectionString(string username, string password) { try { var connectionString = default(string); string strOrgUrl = ConfigurationManager.AppSettings["OrganizationUri"].ToString(); try { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; connectionString = "RequireNewInstance=True; Url=" + strOrgUrl + "; Username=" + username + "; Password=" + password + "; AuthType=Office365;"; } catch (Exception ex) { throw; } return connectionString; } finally { } } }
thanks for every suggestions, the real problem is time issue, finally change the time in server my problem resolved
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2