Does the current version of the Dynamics 365 SDK support connectivity to CRM 2013? Here's my code I'm trying to execute:
string crmConnectionString = String.Format("AuthType=AD;Domain={0};Username={1};Password={2};Url={3}", domain, username, password, "">">http://myserver/myorg");
CrmServiceClient crmServiceClient = new CrmServiceClient(crmConnectionString);
Guid userid = ((WhoAmIResponse)crmServiceClient.Execute(new WhoAmIRequest())).UserId;
After calling the constructor, crmServiceClient.LastCrmError is this:
Unable to login to Dynamics CRM, Error was : The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter schemas.microsoft.com/.../Services:request. The InnerException message was 'Error in line 1 position 518. Element 'schemas.microsoft.com/.../Services:request' contains data from a type that maps to the name 'schemas.microsoft.com/.../Contracts:RetrieveCurrentOrganizationRequest'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'RetrieveCurrentOrganizationRequest' and namespace 'schemas.microsoft.com/.../Contracts'.'. Please see InnerException for more details.
The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter schemas.microsoft.com/.../Services:request. The InnerException message was 'Error in line 1 position 518. Element 'schemas.microsoft.com/.../Services:request' contains data from a type that maps to the name 'schemas.microsoft.com/.../Contracts:RetrieveCurrentOrganizationRequest'. The deserializer has no knowledge of any type that maps to this name. Consider changing the implementation of the ResolveName method on your DataContractResolver to return a non-null value for name 'RetrieveCurrentOrganizationRequest' and namespace 'schemas.microsoft.com/.../Contracts'.'. Please see InnerException for more details.Unable to Login to Dynamics CRM
Unable to Login to Dynamics CRMOrganizationWebProxyClient is null
OrganizationWebProxyClient is null
I've testing this version against and CRM 2015, 2016 and Dynamics 365 and the above code works fine. I couldn't find any backwards compatibility info on this - does anybody know if this is supported?
Thank you,
Joe