Tom Whitner
11-22-2004, 05:07 PM
I am prototyping some functionality with WMI which requires that instrumented assemblies be installed using InstallUtil.exe. I am trying to use Spring to configure my installer class which is simply a class with a collection of installers where each installer in turn may have other collections or data. Each of these classes exist in the .NET framework and simply needs to be initialized and assembled before the master Install() method is called. So, here's the problem. I have everything configured and from a sample exe I have created, I can see that Spring can successfully assemble and configure my class. However, when I run InstallUtil.exe over my assembly, it states that it can not find the first object that is configured. This occurs when Spring uses Assembly.LoadWithPartialName to load the assembly. This method "Loads an assembly from the application directory or from the global assembly cache ..." Because InstallUtil is part of the .NET framework, it is not collocated with my assembly and as a result, my assembly is neither in the application directory, nor the GAC, and I don't want it in the GAC. I am not sure if this is a Spring defect, as I know .NET is very particular about where assemblies are loaded from. However, it is worth noting that InstallUtil itself can load types from my assembly under exactly the same conditions. My guess is that InstallUtil is using Assembly.LoadFile to load the assemblies it is going to install. I tried copying InstallUtil.exe (and InstallUtilLib.dll) into my assembly directory. When run from there, everything worked. I’m throwing this out there to see if anyone has any suggestions to work around this and in case anyone else is considering this approach to configuring InstallUtil.
Thanks,
Tom
Thanks,
Tom