Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Plugin assembly not reloaded after update - IIS restart needed

(0) ShareShare
ReportReport
Posted on by 10

Dear community,

we use a custom tool written in C# and using the Dynamics SDK to deploy plugin assembly binaries to our Dynamics dev environment (on-premise, IsolationMode "None", SourceType "Database").

The tool simply updates the PluginAssembly entity, like:

var context = new ServiceContext(service);
var pluginAssembly = context.PluginAssemblySet.Single(pa => pa.Name == "testpluginassembly");
var upd = new PluginAssembly()
{
	Id = pluginAssembly.Id,
	Content = Convert.ToBase64String(File.ReadAllBytes("testpluginassembly.dll")),
	Description = "test plugin assembly"
};

service.Update(upd);

Note: The plugin assembly is alread present in the dev environment, as well as registered plugins, sdk message processing steps and images.

This technique used to work fine in previous Dynamics versions: After updating the PluginAssembly, the Dynamics server recognized the change and automatically reloaded the plugin assembly in IIS. The changes were effective immediately.

However, in 9.1.0007.0005 version of Dynamics 365 we need to manually restart IIS (or recycle the CRMAppPool) in order to force the Dynamics server to actually reload the plugin assembly. Otherwise the old version of the plugin assembly remains active for minutes to hours and even days.

We tried to increase the plugin assembly version number, however without any effect.

Do you know how to fix this?

Thanks and best regards,

Johannes.

  • Suggested answer
    Johannes R Profile Picture
    10 on at
    RE: Plugin assembly not reloaded after update - IIS restart needed

    Hi,

    We found a workaround. 

    After updating the plugin assembly binaries (see above), we programmatically disable and enable a single (pseudo) SdkMessageProcessingStep. This triggers the reload of the plugin assembly by Dynamics 365.

    var context = new ServiceContext(service);
    var step = context.SdkMessageProcessingStepSet.Single(s => s.Name == PSEUDO_STEP_NAME);
    
    service.Execute(new SetStateRequest()
    {
      EntityMoniker = step.ToEntityReference(),
      State = new OptionSetValue((int)SdkMessageProcessingStepState.Disabled),
      Status = new OptionSetValue((int)sdkmessageprocessingstep_statuscode.Disabled)
    });
    
    service.Execute(new SetStateRequest()
    {
      EntityMoniker = step.ToEntityReference(),
      State = new OptionSetValue((int)SdkMessageProcessingStepState.Enabled),
      Status = new OptionSetValue((int)sdkmessageprocessingstep_statuscode.Enabled)
    });

    Best regards,

    Johannes.

  • Johannes R Profile Picture
    10 on at
    RE: Plugin assembly not reloaded after update - IIS restart needed

    Hi,

    thanks for your reply.

    Publishing all customizations does not solve the problem.

    Regards,

    Johannes.

  • Suggested answer
    Bipin D365 Profile Picture
    28,961 Moderator on at
    RE: Plugin assembly not reloaded after update - IIS restart needed

    Hi,

    You will need to publish customization programmatic after updating the assembly from c#.

    www.inogic.com/.../

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,688 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,643 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans