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 :
Finance | Project Operations, Human Resources, ...
Unanswered

Error when using external packages in C# from x++

(4) ShareShare
ReportReport
Posted on by 44
Hi everyone, I am facing an issue with external depencencies when I reference C# methods in x++. 
 
I am doing this because I was hoping that through C# I could use some packages that are not available in x++.
 
Problem
 
So now I have two solutions in my explorer, where I have a reference from my Finance and Operations project (DynAAM) to my C# .NET Framework project.

I installed two packages from NuGet to the C# project: Microsoft.Graph and Azure.Identity, so my references look like this:
 
When I build both the projects, they compile correctly. I can even call methods that use packages used in the X++ project (like LINQ that was added in the tutorial). 
 
 
But when I try to call something that uses one of the packages that I added from NuGet Finance and Operations throws an error:

- I am qute sure that this is because somehow it does not see the external packages that are not available in Finance and Operations already.
 
 
I also noticed that in the bin directory of the Finance and Operations project there is only like 4 files added which are all called the same as my C# project:
 
 
But in the bin directory of the C# project there are many dll files for the dependencies:
 

Questions

  1. Is this a viable approach for using external packages in X++?
  2. Can I install these dependencies directly into Finance and Operations? My hope was to use external packages this way.
  3. Do I need to build the C# project differently so that all dependencies are included in the X++ bin directory? Would that make sense?

I’d greatly appreciate any advice or insights!

Categories:
I have the same question (0)
  • Martin Dráb Profile Picture
    238,844 Most Valuable Professional on at
    You're right in thinking that the assemblies that you want to use must be in the bin folder (if they aren't already available from elsewhere).
     
    You may need to manually add them there (and to source control). I thought that I got assemblies from NuGet packages copied automatically, but maybe I don't remember it correctly or it has changed.
  • CU03021000-0 Profile Picture
    2 on at
    @Martin Dráb

    We don't have the bin folder in version control. I think it would make sense if the dlls were added in there somehow automatically when I build the C# project... It seems like a lot of hassle to copy and paste it manually.
     
    But I've also heard (https://www.yammer.com/dynamicsaxfeedbackprograms/#/Threads/show?threadId=2251834370580480&search_origin=global&scoring=linear1Y-prankie-group-private-higher&match=any-exact&search_sort=relevance&page=1&search=WindowsAzure.Storage) that when "...There are many different versions of these DLLs within standard D365 and you can't trust which ones are loaded when you want to use your DLL"...

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 470

#3
Adis Profile Picture

Adis 270 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans