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

Could not load file or assembly 'Hl7.Fhir.R4.Core' Plugin error

(0) ShareShare
ReportReport
Posted on by

I was trying to generate a FHIR JSON from a plugin for Dynamics (.Net Framework Class library). I see the below error when the plugin is triggered. All the dependencies have been added to the assembly dll but still I see this error. Assembly registration and Step creation have also been successful. I have tried .Net 4.5, 4.7.1, 4.7.2 - same issue for all. Any help

Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
Message: An unexpected error occurred from ISV code. (ErrorType = ClientError) Unexpected exception from plug-in (Execute): FollowupPlugin.FollowupPlugin: System.IO.FileNotFoundException: Could not load file or assembly 'Hl7.Fhir.R4.Core, Version=1.7.0.0, Culture=neutral, PublicKeyToken=d706911480550fc3' or one of its dependencies. The system cannot find the file specified.Detail:
<OrganizationServiceFault xmlns:i="">www.w3.org/.../XMLSchema-instance" xmlns="">schemas.microsoft.com/.../Contracts">
<ActivityId>d908e678-de19-4dc5-8540-2663a882469a</ActivityId>
<ErrorCode>-2147220956</ErrorCode>
<ErrorDetails xmlns:d2p1="">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): FollowupPlugin.FollowupPlugin: System.IO.FileNotFoundException: Could not load file or assembly 'Hl7.Fhir.R4.Core, Version=1.7.0.0, Culture=neutral, PublicKeyToken=d706911480550fc3' or one of its dependencies. The system cannot find the file specified.</Message>
<Timestamp>2020-06-09T08:01:01.2646169Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource>PluginExecution</ExceptionSource>
<InnerFault i:nil="true" />
<OriginalException>System.IO.FileNotFoundException
at FollowupPlugin.FollowupPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.&lt;&gt;c__DisplayClass15_0.&lt;Execute&gt;b__0()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.Execute(IOrganizationServiceFactory organizationServiceFactory, Dictionary`2 sandboxServices, String pluginTypeName, String pluginConfiguration, String pluginSecureConfig, IPluginExecutionContext requestContext, Boolean enablePluginStackTrace, Boolean chaosFailAppDomain, String crashOnPluginExceptionMessage)
at Microsoft.Crm.Sandbox.SandboxWorker.&lt;&gt;c__DisplayClass3_0.&lt;Execute&gt;b__0()</OriginalException>
<TraceText i:nil="true" />
</OrganizationServiceFault>
I have the same question (0)
  • Community Member Profile Picture
    on at
    RE: Could not load file or assembly 'Hl7.Fhir.R4.Core' Plugin error

    Thank you Andrew, that helps

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Could not load file or assembly 'Hl7.Fhir.R4.Core' Plugin error

    Hello,

    If you haven't used ILMerge - that's the reason why you'getting that error. When you build the plugin and not use ILMerge code of assembly is not placed anywhere and cloud infrastructure just doesn't know where it can take the code from... and as a result you get that error.

    I would not recommend usage of ILMerge but it could resolve your issue. You can check following post that describes on how you can put referenced assemblies to resulting assembly using ILMerge - nishantrana.me/.../

    Obviously you will have to pay for Azure Functions but this allows you to use any kind of assemblies, you don't have timeout issue e.t.c.

    It's up to you to decide which way to go but I would highly recommend to take a look on Azure Functions and consider that approach over ILMerge.

  • Community Member Profile Picture
    on at
    RE: Could not load file or assembly 'Hl7.Fhir.R4.Core' Plugin error

    Hi Andrew. I haven't used ILMerge yet. I did see some posts referring to ILMerge saying the referred dlls be merged and then registered. If I understand correctly, what you are pointing to is that the issue is because the project build doesn't have the dll for HL7.FHIR.R4 - I am getting an error. Now though the solution is to actually merge all dlls, but it is not recommended to do so and instead leverage Azure Functions.

    So is it the case with few Nuget packages or all? Because if it is for all then just wondering if Nugets could ever be utilized in Plugins. Also Azure Function has some costs involved. Correct me if I am wrong. Thank you

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Could not load file or assembly 'Hl7.Fhir.R4.Core' Plugin error

    Hello,

    Microsoft doesn't recommend to use ILmerge (or other way of merging of assemblies). I would recommend to offload this logic to Azure Function where you can use any assemblies.

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daniyal Khaleel Profile Picture

Daniyal Khaleel 122

#2
DAnny3211 Profile Picture

DAnny3211 101

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans