web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Sdk.Deployment, Version=9.0.0.0

(0) ShareShare
ReportReport
Posted on by 5

Hi,

I am in the process of developing a dynamics workflow activity in .net 4.6.2 but I am experiencing issues. I developed this plugin locally first using a console application and everything works perfectly find on that. I tried to copy the same packages and versions to my plugin project but that doesn't do anything. I tried uninstalling all packages and getting latest versions and that still doesn't work. I have been able to narrow the issue down to the exact line of code:

var client = new CrmServiceClient("Url=[dynamics url]; AuthType=Office365; Username=[username]; Password=[password]; SkipDiscovery=true;");

Keep in mind I copy pasted my exact console app code (which is functional).

I am receiving the workflow context, but I need the CrmServiceClient object in order to send emails, so removing this package is not going to be possible for me unless I am somehow able to extract CrmServiceClient from context.

Screenshot of my installed packages:

pastedimage1597257980431v1.png

Screenshot of object explorer for solution the solution is legacy contains multiple projects:

pastedimage1597258207023v2.png

I have been searching for a solution to this issue for about a week now. I have tried various "solutions" including adding binding redirect to my app.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Xrm.Tooling.Connector" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name=" Microsoft.Xrm.Sdk=" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.19.8.16603" newVersion="3.19.8.16603" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Here is the exact error log that Dynamics is giving me:

Unhandled exception:
Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
Message: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.Crm.CrmException: An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute): Wcp.Cds.Payments.SendPaymentScheduledEmail: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Sdk.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
at Microsoft.Crm.Dialogs.RunWorkflowDialogPage.ConfigureForm()
at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
at Microsoft.Crm.Application.Controls.AppPage.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #A3F8DFA1Detail:
<OrganizationServiceFault xmlns:i="">www.w3.org/.../XMLSchema-instance" xmlns="">schemas.microsoft.com/.../Contracts">
<ActivityId>bffa9203-5bfb-4127-a3ba-994cacdf3386</ActivityId>
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="">schemas.datacontract.org/.../System.Collections.Generic" />
<HelpLink i:nil="true" />
<Message>System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---&gt; Microsoft.Crm.CrmException: An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute): Wcp.Cds.Payments.SendPaymentScheduledEmail: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Sdk.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
at Microsoft.Crm.Dialogs.RunWorkflowDialogPage.ConfigureForm()
at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)
at Microsoft.Crm.Application.Controls.AppPage.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #A3F8DFA1</Message>
<Timestamp>2020-08-12T18:15:29.0821257Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault>
<ActivityId>bffa9203-5bfb-4127-a3ba-994cacdf3386</ActivityId>
<ErrorCode>-2147220891</ErrorCode>
<ErrorDetails xmlns:d3p1="">schemas.datacontract.org/.../System.Collections.Generic" />
<HelpLink i:nil="true" />
<Message>An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute): Wcp.Cds.Payments.SendPaymentScheduledEmail: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Sdk.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.</Message>
<Timestamp>2020-08-12T18:15:29.0821257Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText>

I have tried a million different suggestions from older threads, including downgrading all packages, reinstalling latest, adding binding redirects etc but nothing seems to work. Help is appreciated.
I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Sdk.Deployment, Version=9.0.0.0

    Hello,

    You can get IOrganizationService instance from the context. You don't need Tooling in your project.

    Check following example - docs.microsoft.com/.../workflow-extensions

  • Anees_ Profile Picture
    5 on at
    RE: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Sdk.Deployment, Version=9.0.0.0

    I modified my Email class to use IOrganizationService instead of CrmServiceClient and this fixed the issue. Thank you so much, this problem has been driving me crazy. Is there a reason why the tooling package throws errors in dynamics?

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Xrm.Sdk.Deployment, Version=9.0.0.0

    Tooling package is not available in the sandbox - that's the main reason why it throws exceptions.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 179 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 110

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 61 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans