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
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,
thanks for every suggestions, the real problem is time issue, finally change the time in server my problem resolved
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
Justin Jose
Hi,
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();
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
connectionString = "RequireNewInstance=True; Url=" + strOrgUrl + "; Username=" + username + "; Password=" + password + "; AuthType=Office365;";
}
catch (Exception ex)
{
throw;
}
return connectionString;
}
finally
{
}
}
}
Hi,
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.
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
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 Alex,
i tried this one , but error remains same
Hi Alex,
Thanks for your reply , i try this one and update you
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:
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