Good afternoon,
I’m creating a class that connects to CRM On Line version v.9.2, but I’m getting the error “Unable to Login to Dynamics CRMOrganizationServiceProxy is null”, can someone help me, below is the code I’m using
D365ConsoleCRUD namespace
{
class Program
{
static void Main(string[] args)
{
OAuthConnexion connection = new OAuthConnexion();
CrmServiceClient svc = connection.ConnectionOAuth();
if(svc.IsReady)
{
Console.WriteLine(“With Connection”);
}
else
{
Console.WriteLine(“No Connection”);
}
}
}
}
public class OAuthConnection
{
public CrmServiceClient ConnectionOAuth()
{
string url = ““>xxxxxx.crm2.dynamics.com”;
string userName = “xxxx@hotmail.com”;
string passWord = “xxxxx”;
string con = $@”
Url = {url};
AuthType = Office365;
userName = {userName};
passWord = {passWord};
RequiredNewInstance = True”;
CrmServiceClient svc = new CrmServiceClient(con);
return svc;
}
}