Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

How to use local version of C# dll instead of IIS default version of the library in an X++ Project?

(0) ShareShare
ReportReport
Posted on by 2

Hello,

I have a C# project where I have added 2 reference dlls Microsoft.Extensions.DependencyInjection.Abstractions and Microsoft.Extensions.DependencyInjection.

I also have a X++ project where I use this C# project. So I first build the C# project and then add it as a reference in my X++ project.

The issue I am facing is that there are already an older versions of Microsoft.Extensions.DependencyInjection.Abstractions and Microsoft.Extensions.DependencyInjection present in AosService//PackagesLocalDirectory//bin directory.

The library I have included is present in K://AosService//PackagesLocalDirectory//MyModel//bin after the build.

Now during runtime, when the X++ code calls the .Net classes, IIS service loads the version of the library from PackagesLocalDirectory instead of MyModel's directory. Which gives me an error in my code.

I tried to delete the dll from PackagesLocalDirectory, in which case it is loading the dll from MyModel's bin and my code runs fine in this case.

Now I don't want to delete dlls from PackagesLocalDirectory and it's also not possible in production. Is there any way so I can load my version of the dll at runtime ? 

It is similar to issue mentioned in the post https://community.dynamics.com/forums/thread/details/?threadid=7d01d7ee-7945-42fd-a0f6-24a0b5524bd5, however the solution provided in the post is something that is not feasible in my case.

Also that is very old post hoping that something might have been changed since then.

Thanks in Advance

Amit

  • Community member Profile Picture
    2 on at
    How to use local version of C# dll instead of IIS default version of the library in an X++ Project?
    I am not able to use the version present in F&O it is old one, that means I am left with only choice of moving my logic outside of F&O.
  • Suggested answer
    Martin Dráb Profile Picture
    233,019 Most Valuable Professional on at
    How to use local version of C# dll instead of IIS default version of the library in an X++ Project?
    There is no way, as far as I know. And that's what Microsoft confirmed in the thread you mentioned.
     
    You could do it in your development environment, but not in production, therefore it would solve nothing.
     
    Therefore either you stick to the version used by F&O, or you implement your logic outside F&O (e.g. in an Azure function).

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,281 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,019 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans