Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Upgrade from crm 2013 to 2016

Posted on by Microsoft Employee

Hi,

We developped an application that communicate with our crm 2013. Almost all the interactions was with the Microsoft.Xrm.Client librairy from the sdk 2015. We upgrade the crm to the 2016. Since then, nothing worked anymore. First, we can't upgrade with the 2016 sdk. The Microsoft.Xrm.Client is not there anymore. Also, if we upgrade, all the logics and interactions with entities are completly different. Thanks to Microsoft...

I tried different solutions but I'm always stuck on different issues. I didn't find anything saying if I can stay with the sdk 2015 and the Microsoft.Xrm.Client library to communicate with the crm 2016. I have always the error :

"The maximum nametable character count quota (16384) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing - long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 1298."

I don't find how to upgrade the MaxNameTableCharCount in the XmlDictionaryReaderQuotas. This happened in this piece of code :

Dim cn As Microsoft.Xrm.Client.CrmConnection = Microsoft.Xrm.Client.CrmConnection.Parse("Url=" & DomainName & "; Username=" & modGlobal.gUserName & "; Password=" & modGlobal.gPWD)
 
        Using service = New OrganizationService(cn)
            Dim qry As New QueryExpression("new_workorder")
            qry.ColumnSet.AllColumns = True
            Dim result1 As EntityCollection = service.RetrieveMultiple(qry) 

On the 

I get the error on the line " service.RetrieveMultiple(qry)".

Please help!

Ben

*This post is locked for comments

  • JohnLeme Profile Picture
    JohnLeme 355 on at
    RE: Upgrade from crm 2013 to 2016

    Aric, that didn't work for me after the update to 365 (8.2) that happened yesterday. I used to connect with:

    CrmServiceClient client1 = new CrmServiceClient(ConfigurationManager.ConnectionStrings["XrmPowerString"].ConnectionString);

    But now I get the errors:

    Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Unable to Login to Dynamics CRM

    and

    Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Source : mscorlib Method : HandleReturnMessage Date : 14/08/2017 Time : 01:46:02 Error : An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.

    I tried your code with the same result. I was able to connect with the coed below:

    ServerConnection.Configuration config = new ServerConnection.Configuration();
                config.OrganizationUri = new Uri("myorg.api.crm.dynamics.com/.../Organization.svc");
                config.Credentials = new ClientCredentials();
                config.Credentials.UserName.UserName = "myname@myorg.com";
                config.Credentials.UserName.Password = "mypassord";
    
                // Establish an authenticated connection to the Organization web service. 
                OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(config.OrganizationUri, config.HomeRealmUri,
                                                            config.Credentials, config.DeviceCredentials);

    Any idea why the Microsoft.Xrm.Tooling.Connector aint working?
  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Upgrade from crm 2013 to 2016

    I got it! I had misunderstand something but your peace of code, Aric, is running like charm! Also, I followed the sample of Andrew link to update my project references.

    Thanks to you guys!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Upgrade from crm 2013 to 2016

    Hi Andrew, I work with your link. Thanks a lot!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Upgrade from crm 2013 to 2016

    Hi Aric and thanks for your response. I began the upgrade with the new sdk. I followed your sample and the authentification is running well. Now, in my previous version, I used OrganizationService() to obtain an instance to the entities but this object is in Microsoft.Xrm.Client library. Which is the OrganizationService equivalent with the last sdk?

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Upgrade from crm 2013 to 2016

    Hello,

    I would suggest to migrate your app to use Xrm.Tooling - butenko.pro/.../migrating-apps-microsoft-xrm-client-microsoft-xrm-tooling

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Upgrade from crm 2013 to 2016

    Try using the Microsoft.Xrm.Tooling.Connector library in the new SDK. You can use the following method, or also use the connection string stored in your config file.

    IOrganizationService _orgService;

    NetworkCredential creds = new NetworkCredential(userName, ConvertToSecureString(CRM_PASSWORD));

    Microsoft.Xrm.Tooling.Connector.AuthenticationType authType = Microsoft.Xrm.Tooling.Connector.AuthenticationType.IFD;

    CrmServiceClient conn = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(creds, authType, internalUrl, "443", orgName, true, true, null);

    _orgService = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;

    Good luck.

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.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans