Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Error in Console CRM Connection Class for Version 9.0.1.425

Posted on by 315

Hi Dear All,

I have created one console Application to Connect with CRM D365 version 9.0.1.425 it was throwing the Error .

Below Are the Error Details:

 Metadata contains a reference that cannot be resolved: 'crm.api.crm8.dynamics.com/.../Organization.svc;sdkversion=9'."}

I am using the DLL Versions of 9.0.9002.0.

Please suggest me the answer for the Same.

Regards,

Krishna.

*This post is locked for comments

  • Verified answer
    Krishna potdar Profile Picture
    Krishna potdar 315 on at
    RE: Error in Console CRM Connection Class for Version 9.0.1.425

    Hi Ravi,

    Thanks For the Code and suggestion.

    I Have tried my code which i have mentioned earlier it is working fine.

    The problem with that is System.Runtime.Serialization namespace was not added.

    Regards,

    Krishna.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Error in Console CRM Connection Class for Version 9.0.1.425

    Hi,

    Could you please try this code. This is working fine for me. I created a new project in VS 2017 [.Net Framework 4.6.1], added nuget package to CrmSdk core assemblies [v9.0.0.7]

    =================

    public void CreateAccount()

           {

               var cred = new ClientCredentials();

               cred.UserName.UserName = "XXX@XXXXX.onmicrosoft.com";

               cred.UserName.Password = "XXXX";

               var orgURI = "xxxxx.crm6.dynamics.com/.../Organization.svc";

               using (service = new OrganizationServiceProxy(new Uri(orgURI), null, cred, null))

               {

                   Entity newRecord = new Entity("account");

                   newRecord["name"] = "Test";

                   newRecord["accountnumber"] = "12345";

                   service.Create(newRecord);

               }

           }

    ====================

    Hope this helps.

  • Verified answer
    Krishna potdar Profile Picture
    Krishna potdar 315 on at
    RE: Error in Console CRM Connection Class for Version 9.0.1.425

    Hi Ravi,

    Yes i am Using the Same V9 Dll's, But still getting the below mentioned Error.

    Additional information: Unexpected exception from plug-in (Execute): ProfiledTypes.ProfilerTypefcddf078b1114aef9dded41a7589ad74: System.Security.SecurityException: The data contract type 'Microsoft.Xrm.Sdk.OrganizationServiceFault' cannot be serialized in partial trust because the property 'ExceptionRetriable' does not have a public getter.

    Code Which i am using to connect.

    class CrmConsoleConnection
    {
    static void Main(string[] args)
    {
    CrmConnection connectionClass = new CrmConnection();
    IOrganizationService Service = connectionClass.Service("USerName@crm.onmicrosoft.com", "Crm@123", "", "crm.api.crm8.dynamics.com");
    Entity EmployeeEntity = new Entity("new_employee");
    EmployeeEntity["lvt_name"] = "Hi WElcome to CRM";
    Service.Create(EmployeeEntity);--Error While Create on new__Employee record 



    }
    }
    public class CrmConnection
    {
    public IOrganizationService Service(string username, string password, string domain, string server)
    {
    System.IO.StreamWriter file = null;
    IOrganizationService service = null;
    string lines = "";
    try
    {
    ClientCredentials cre = new ClientCredentials();
    cre.UserName.UserName = username;
    cre.UserName.Password = password;
    Uri serviceUri = new Uri("crm.api.crm8.dynamics.com/.../Organization.svc");
    //One Extra Line Perform the connection
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
    OrganizationServiceProxy proxy = new OrganizationServiceProxy(serviceUri, null, cre, null);
    proxy.EnableProxyTypes();
    service = (IOrganizationService)proxy;

    }
    catch (Exception ex)
    {
    Console.WriteLine(ex.Message);

    }
    return service;
    }
    }

    Regards,

    Krishna.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Error in Console CRM Connection Class for Version 9.0.1.425

    Hi Krishna,

    If you are connecting to V9 with V9 dll's then it should work. You sure you have the correct org url, username & password?

    If the URL & credential are correct and you are still facing the issue then please share your code.

    Hope this helps.

  • Krishna potdar Profile Picture
    Krishna potdar 315 on at
    RE: Error in Console CRM Connection Class for Version 9.0.1.425

    Hi Dear All,

    To resolve the Above Mentioned issue i have Applied The Code from the below mentioned Link.

    debajmecrm.com/.../fixed-error-while-connecting-to-dynamics-365-version-9-0-metadata-contains-a-reference-that-cannot-be-resolved

    But now it was throwing me the Different Error.

    Error Details mentioned Below

    Additional information: Unexpected exception from plug-in (Execute): ProfiledTypes.ProfilerTypefcddf078b1114aef9dded41a7589ad74: System.Security.SecurityException: The data contract type 'Microsoft.Xrm.Sdk.OrganizationServiceFault' cannot be serialized in partial trust because the property 'ExceptionRetriable' does not have a public getter.

    Please suggest me the answer for the Same.

    Regards,

    Krishna.

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Error in Console CRM Connection Class for Version 9.0.1.425

    Hi Krishna ,

    Which version of CRM you are using ? Can you please downgrade your DLL version and check.

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Error in Console CRM Connection Class for Version 9.0.1.425

    Hi Krishna ,

    Which version of CRM you are using ? Can you please downgrade your DLL version with 8.2.

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