Friday, May 19, 2006

Private and GAC deployment.

I did a little test over the .Net dll deployment testing two nights ago. I thought I needed to write it down.

The thing confused me a little bit is if I install the same version of a dll both in the GAC and Private path ( the application path), will the application look for the dll in the GAC or Private Path.

I made a simple test dll, and there is a test method which will display a message box. In the dll which I depoloyed to GAC, I will disaplay a message box "Called from GAC", in the private deployed dll, I will display a message box "Called from Local".

I also made a simple test application which will refer to the test dll.

If I install the dll into GAC using the GACUtil /i, it will dispaly the following message box.








However, if I unistall the GAC , and then the test application will call the dll from the local private path, then the following message box will be displayed.









Conclusion, if an assembly is deployed both in the GAC and privately, the one in the GAC will be called firstly.
Tags:GISResearch

No comments: