web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    236,320 Most Valuable Professional on at
    Error when using external packages in C# from x++
    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
    Error when using external packages in C# from x++
    @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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,100

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 890 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 633 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans