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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Microsoft.Xrm.CoreAssemblies 9.0.2.45 comes with System.Text.Json that comes with many dependencies. How to use latest Microsoft.Xrm.Sdk?

(0) ShareShare
ReportReport
Posted on by 213

So I want to update CoreAssemblies to 9.0.2.45. But since 9.0.42 it depends on System.Text.Json, which has lots of dependencies:

So now I want to deploy this plugin, that depends on latest CoreAssemblies. I have CRM 9.1 On-Prem May 2022 Update: 9.1.0010.0102. I try out some action and get some error from my plugin (that is not actually related to those dependencies but is related issue)

>System.MissingMethodException: Method not found: 'Boolean Microsoft.Xrm.Sdk.ParameterCollection.TryGetValue(System.String, !!0 ByRef)'.
>   at DEAC.CRM.CRM.Main.Plugin.EmailTicketCreate.OnPreCreate(IServiceProvider serviceProvider)
>   at DEAC.CRM.Plugin.BasePlugin.Execute(IServiceProvider serviceProvider): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #C7310F1D

Alright, the relevant line:

if (localContext.PluginExecutionContext.ParentContext.SharedVariables.TryGetValue("sssUserId", out object sssUserIdObject)) {

Hmm, let's see how "C:\Program Files\Dynamics 365\CRMWeb\bin\Microsoft.Xrm.Sdk.dll" compares with what NuGet gave me:

  • CRM Server:  [assembly: AssemblyVersion("9.0.0.0") [assembly: AssemblyFileVersion("9.0.46.7901") 
  • NuGet:  [assembly: AssemblyVersion("9.0.0.0") [assembly: AssemblyFileVersion("9.2.47.9489") - So nuget is newer

Yeah, Server version doesn't have TryGetValue. Except it was always there, pre-v9.1

2022_2D00_07_2D00_19-12_5F00_06_5F00_37.png

I don't know when that method disappeared, it was there pre-9.1 and is even documented: ParameterCollection.TryGetValue<T>(String, T) Method (Microsoft.Xrm.Sdk) | Microsoft Docs - however the question is more about how can I use the latest CoreAssemblies with baggage of dependencies? I don't see System.Text.Json.dll or any other of those dependencies in C:\Program Files\Dynamics 365\CRMWeb\bin and I don't see them referenced in in C:\Program Files\Dynamics 365\CRMWeb\bin\Microsoft.Xrm.Sdk.dll:

2022_2D00_07_2D00_19-16_5F00_19_5F00_58.png


Thus I don't even think that I'll be able to do without ILMerging those dependencies.

Does Microsoft really pushes us to use a tool they officially do not support? (ILMerge). Using these nuget packages is something microsoft officially recommends: Choose your development style for Dynamics 365 Customer Engagement (Developer Guide for Dynamics 365 Customer Engagement (on-premises)) | Microsoft Docs and a quote directly from there:

You should use the latest version of the SDK assemblies to create your plug-ins, custom workflow activities, or XAML workflows. Starting with version 9.x, you should use .NET Framework version 4.6.2.

 

On the one side, I am broken without using ILMerge and I am screwed using ILMerge. So I now instruct my build to ILMerge Microsoft.Xrm.Sdk with the newly added dependency System.Text.Json and I get:

Unresolved assembly reference not allowed: System.Text.Json.

No problem, we have a solution for that. Except it doesn't work.

What am I doing utterly wrong?

P.S. I also see that there is a transition from Microsoft.Xrm.CoreAssemblies to Microsoft.PowerPlatform.Dataverse.Client as written in Transition client applications to Dataverse ServiceClient - Power Apps | Microsoft Docs however it does not apply to on-prem, quoting: "On-premise applications - this article is not for you, yet"

I have the same question (0)
  • Suggested answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    if you just need to write plugins AND you are onpremise you can just use a previous nuget package, you don't need to use the latest.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 202 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 70

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans