Reputation: 505
I'm trying to connect to CRM Online via connection string using Microsoft.CrmSdk.XrmTooling.CoreAssembly v 8.2.0.5
Following the guidelines at MSDN my connection string looks like this: AuthType=Office365;[email protected]; Password=passcode;Url=https://contoso.crm.dynamics.com
However, I get error an exception of type System.ArgumentNullException
with Message: Organization cannot be null or empty.
Parameter name: Organization Name
Source: Microsoft.Xrm.Tooling.Connector
public void GetClient()
{
try
{
var client = new CrmServiceClient(GetConnectionString());
Assert.IsTrue(client.IsReady);
}
catch (Exception ex)
{
throw;
}
}
private string GetConnectionString()
{
try
{
var connectionString = default(string);
try
{
connectionString = "AuthType:Office365;Url=https://MyCRM.crm4.dynamics.com; [email protected];Password=MySecretPasscode;";
}
catch (Exception ex)
{
throw;
}
return connectionString;
}
finally
{
}
}
Upvotes: 0
Views: 3386
Reputation: 1
you still need to put the org name at the end of the url so it should be someting like this:Url=https://contoso.crm.dynamics.com/contoso;
Upvotes: -1
Reputation: 3586
The problem is here:
"AuthType:Office365; ..."
This should be:
"AuthType=Office365; ..."
Upvotes: 4
Reputation: 312
you have to write the connectionstring like this:
<add name="Server=CRM Online,
organization=contoso, user=someone"
connectionString="Url=https://contoso.crm.dynamics.com;
[email protected]; Password=password; authtype=Office365"/> -->
Hope this help!
Upvotes: 0