tags:

views:

35

answers:

2

I have a program which references a DLL. Code in this DLL gets the directory of the executing DLL and uses that to look for an XSD file to load (i.e. I expect the code to be executing from c:\foo\my.dll so it looks for c:\foo\validation.xsd).

On of the thousands of customer installations I have this works fine. However in one case the DLL is being installed in the GAC. This means that when it looks for the XSD file it can't find it as the executing directory it is given is that of the GAC rather than c:\foo.

My question is: Is this a feature of Windows/.net which is causing it to be installed in the GAC under some circumstances? The installer clearly isn't putting the DLL in the GAC as a matter of course otherwise I would have this problem showing up all over the place.

I have search Stackoverflow and Google and while there is plenty of information on installing and removing files from the GAC I can't find anything which says that this can happen automatically. I wonder whether an administrator at the customer site is putting these DLLs in there manually. It seems unlikely that they would bother but you never know what users will do!

Thanks,

Xanthalas

A: 

I don't believe it happens automatically, but if a separate application which uses the same dependency has registered it in the GAC, that could explain what you're seeing. In that case the user may not have done anything with the DLL deliberately or knowingly.

Jon Skeet
A: 

Someone would have installed the assembly in the GAC, probably using Gacutil.

Assemblies do not install themselves in the GAC.

Oded