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, ...
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,699 Moderator on at
    RE: How To Get Packages LocalDirectory Path In d365

    Do you want to use that dll in the code ?

  • WillWU Profile Picture
    22,361 on at
    RE: How To Get Packages LocalDirectory Path In d365

    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
    on at
    RE: How To Get Packages LocalDirectory Path In d365

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

  • Suggested answer
    Rahul Mohta Profile Picture
    21,032 on at
    RE: How To Get Packages LocalDirectory Path In d365

    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,775 on at
    RE: How To Get Packages LocalDirectory Path In d365

    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

Responsible AI policies

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

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

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

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 743

#3
Sumit Singh Profile Picture

Sumit Singh 551

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans