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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Dynamics 365 v9 (on premise) and Plugins using .NET 4.6.2

(3) ShareShare
ReportReport
Posted on by 80

Hi all,

I'm wondering if anyone has been able to build a plugin using .NET 4.6.2 on Dynamics 365 V9 on premise using the latest Microsoft.CrmSdk.CoreAssemblies (currently 9.0.2.34. We tried to do that but we are getting a runtime error.

The version of Dynamics we are testing this on is Microsoft Dynamics 9.0.3.7 on premise 

pastedimage1630012598828v3.png

We tried the following combinations:

- .NET 4.5.2 - Microsoft.CrmSdk.CoreAssemblies 8.2.0.2: Works fine!

.NET 4.5.2 - Microsoft.CrmSdk.CoreAssemblies 9.0.2.5Works fine!

- .NET 4.5.2 - Microsoft.CrmSdk.CoreAssemblies 9.0.2.34: Plugin registration tool gives the error “Currently, Microsoft Dynamics 365 requires the .NET Framework version 4.6.2 for plug-in assemblies. Rebuild the assembly with the .NET Framework version 4.6.2 and try again.” 

- .NET 4.6.2 - Microsoft.CrmSdk.CoreAssemblies 9.0.2.34: Plugin registration is able to register the plugin but we get the following error at runtime: "Could not load file or assembly '<Our assembly name>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b4ec06d9a40abb18' or one of its dependencies. The system cannot find the file specified." 

NOTE: We also tried to deploy exactly the same assembly in Dynamics Online/Dataverse and it works fine!

In all cases we are using Isolation Mode as Sandbox and location as Database (see screenshot below) 

pastedimage1630011957236v1.png

We also switched on assembly binding logging and got the following logs:

LOG: This bind starts in default load context.

LOG: Using application configuration file: C:\Program Files\Dynamics 365\Server\bin\Microsoft.Crm.Sandbox.WorkerProcess.exe.Config

LOG: Using host configuration file:

LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.

LOG: Post-policy reference: <Our Assembly name>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b4ec06d9a40abb18

LOG: Attempting download of new URL file:///C:/Program Files/Dynamics 365/Server/bin/<Our Assembly name>.DLL.

LOG: Attempting download of new URL file:///C:/Program Files/Dynamics 365/Server/bin/<Our Assembly name>/<Our Assembly name>.DLL.

LOG: Attempting download of new URL file:///C:/Program Files/Dynamics 365/Server/bin/<Our Assembly name>.EXE.

LOG: Attempting download of new URL file:///C:/Program Files/Dynamics 365/Server/bin/<Our Assembly name>/<Our Assembly name>.EXE.

It appears that the Sandbox service is trying to find the assembly locally rather than in the database. The same assembly works just fine if we build it with target framework as .NET 4.5.2

Any help on this is much appreciated

Thanks

Juan

I have the same question (0)
  • Suggested answer
    Nya Profile Picture
    29,060 on at
  • juancho Profile Picture
    80 on at

    Thanks very much for your reply Nya!

    I've seen that article but we don't get the error in the plugin registration tool when we use .NET 4.6.2 and the latest version of Microsoft.CrmSdk.CoreAssemblies, We are able to register the plugin successfully.

    The problem for us is that the Sandbox service can't find our assembly, it looks as if it's trying to search it in the local system rather in the database as it does for 4.5.2.

    Not sure if this provides any clue but I opened the Sandbox executable from the server using JustDecompile and the Sandbox service executable itself has been compiled targeting .NET 4.5.2.

    What I'm trying to figure out is if Dynamics 365 On premise doesn't support .NET 4.6.2 full stop or if there is anyone in the community that is running plugins compiled in.NET 4.6.2 and if so, how

    pastedimage1630057010635v3.png

    Thanks

    Juan

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 80

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans