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, ...
Suggested Answer

How To Get Packages LocalDirectory Path In d365

(0) ShareShare
ReportReport
Posted on by 170

Hi , 

 Anyone please tell me how I can get path of Packages LocalDirectory folder present inside AOSService, since I want to access Dll that is present inside bin folder of PackagesLocalDirectory 

I have the same question (0)
  • Sukrut Parab Profile Picture
    71,741 Moderator on at

    Do you want to use that dll in the code ?

  • WillWU Profile Picture
    22,363 on at

    Hi Uzair,

    What do you want to do with the file.

    You can add reference like this.

    Capture75542.PNG

    You can also add a reference to a .Net assembly, then an AxReference element is added to your model and the assembly (dll) is automatically copied to the bin folder of your package. For example, If you are developing in the model ISVModel1 that belongs to the package ISVPackage1:

    1.The assembly will be copied to <PackagesLocalDirectory>\ISVPackage1\bin\Thirdpartyassembly.dll
    2.An AXReference is created in <PackagesLocalDirectory>\ISVPackage1\ISVModel1\AxReference\Thirdpartyassembly.xml

    Hope this helps.

  • Suggested answer
    Martina123 Profile Picture
    Microsoft Employee on at

    The default Packages LocalDirectory folder is C:\AOSService\PackagesLocalDirectory, but the drive can change for different environments

  • Suggested answer
    Rahul Mohta Profile Picture
    21,046 on at

    in local VHD it's in path as suggested by Martina and in Cloud hosted either by MS or your own subscription could be be J or I drive

  • Suggested answer
    Joris dG Profile Picture
    17,780 on at

    There is a more generic way than guessing drives. However, before we get into that I want to try and convince you that this is the wrong way to go about it.

    You can NOT depend on infrastructure (paths etc), and loading assemblies explicitly is never a good idea. The packages/bin is in the probe path, and also most DLLs in there will be loaded already anyway. As pointed out in this thread, consider just using a reference and leave the loading of the assembly to the system. If you're planning to use reflection and want to use some of those functions that need the path to the DLL -please don't. Reflection is a virtually guaranteed way to have your system break in some future update.

    But finally, sure. There should be an environment variable called "service drive" that points to the drive letter. Append aosservice/packageslocaldirectory (but again, this could change in the future and your code would just break).

    Please figure out a different way and avoid needing the paths.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 804

#2
André Arnaud de Calavon Profile Picture

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

#3
Subra Profile Picture

Subra 528

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans