Visual Studio Tool: Order of class libraries(dll) initialization in Dynamics GP

| 08/25/2012 | 0 Comments

I came across a post on Dynamics GP forum related to order in which Additional Menu items from multiple Visual Studio Addins are loaded. I decided to test this to figure out the order in which assemblies are initialized.

For testing, I created two GP addins – DynamicsGPAddin1 and DynamicsGPAddin2.

In both addins, I added simple code to display a message box during initializing process and added additional menu option for Customer Maintenance Window.

DynamicsGPAddin1

rmForm.AddMenuHandler(menu1, "DynamicsGPAddin1");

MessageBox.Show("DynamicsGPAddin1");

DynamicsGPAddin2

rmForm.AddMenuHandler(menu2, "DynamicsGPAddin2");

MessageBox.Show("DynamicsGPAddin2");

Idea was to check which message box is displayed first to determine the order in which assemblies are loaded. When I added both dlls in my GP folder order in which message box were displayed was DynamicsGPAddin1 and DynamicsGPAddin2.

The two possibilities that came to my mind were alphabetical order or by date modified (DynamicsGPAddin1 was compiled first).

Order of menu options visible in the Customer maintenance was also same.

To further isolate the order, I simply renamed my DynamicsGPAddin1 dll to DynamicsGPAddin3

Now, the order in which message boxes were displayed was reversed. Also, the order in which menu were displayed was reversed

 

This helped me to reach the conclusion that  assemblies in the addins folder in GP are loaded in the alphabetical order. It depends upon the name of dlls and not on the caption of the menu items.

 

Taken from:
Visual Studio Tool: Order of class libraries(dll) initialization in Dynamics GP

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Tags: ,

Category: Blogs I Follow

About the Author ()