Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Could not load type 'Microsoft.Xrm.Sdk.Deployment.DeploymentServiceFault' from assembly 'Microsoft.Xrm.Sdk

(0) ShareShare
ReportReport
Posted on by 350

Good day to everyone. I would appreciate your advise about how to troublsehoot this issue:

Scenario:

  • SSIS project with target to SQL 2016 and created using VS 2017
  • C# Script component that needs to connect to Dynamics 365 v9 Online. Code target to .net 4.6.2. SDK references to the lastest dll versions available in nuget.
  • Script compiled with no errors.
  • Connection String tested in XRM Toolbox with no problems.

Problem:

The line of code in the Script:

  •  CrmServiceClient crmConn = new CrmServiceClient(connectionStringCRM);

Produces the following exception:

  • Could not load type 'Microsoft.Xrm.Sdk.Deployment.DeploymentServiceFault' from assembly 'Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

I tried the same approach and code several times in other projects with no problems so this time I am totally lost.

Thanks for any advice.

*This post is locked for comments

  • Xavier Villafuerte Profile Picture
    Xavier Villafuerte 350 on at
    RE: Could not load type 'Microsoft.Xrm.Sdk.Deployment.DeploymentServiceFault' from assembly 'Microsoft.Xrm.Sdk

    After a little bit of troubleshooting I found the cause for the problem. Because I was working on a SSIS package, I was using the approach documented in this link "blogs.msdn.microsoft.com/.../" to use the SDK dlls from a local path. It seems that the order of the dlls being called in the methods described in the article it is important because when the Xrm.Tooling.Connector.dll  reference was included prior to the Xrm.Sdk.dll, the connection worked like a charm even thought there was no any reference to the Microsoft.Xrm.Sdk.Deloyment.dll in the project. I hope this helps somebody in the future.

  • Xavier Villafuerte Profile Picture
    Xavier Villafuerte 350 on at
    RE: Could not load type 'Microsoft.Xrm.Sdk.Deployment.DeploymentServiceFault' from assembly 'Microsoft.Xrm.Sdk

    Thanks Abby. Microsoft.Xrm.Sdk.Deloyment.dll was already referenced in the project and it was obtained from nuget. The latest version of the dll was 9.0.2.12. Problem is still there.

  • Suggested answer
    Abby Kong Profile Picture
    Abby Kong 6 on at
    RE: Could not load type 'Microsoft.Xrm.Sdk.Deployment.DeploymentServiceFault' from assembly 'Microsoft.Xrm.Sdk

    Hi Xavier,

    The exception seems to be about Microsoft.Xrm.Sdk.Deployment, this package contains Microsoft.Xrm.Sdk.Deloyment.dll, can you try adding this NuGet package?

    www.nuget.org/.../Microsoft.CrmSdk.Deployment

    If you've got it working in XrmToolBox, you can open the folder where XrmToolBox is and check if that DLL is inside.

    Regards,
    Abby

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans