Hi,
This is a large project. I will try to narrow down the problem down as
simply as I can
- I have an app compiling and running from: "c:\myapp\myapp.exe"
- The app's main form has an Assembly member
- The main form loads up an assembly from "c:\\assembly\\myassembly.dll"
using the following command (names changed): this.myAssembly =
AppDomain.CurrentDomain.Load(AssemblyName.GetAssem blyName(c:\\assembly\\myassembly.dll"));
- Needless to say there is no project reference between my application and
the "myassembly.dll"
- At this point, I can easily instantiate types from the assembly using
"Activator.CreateInstance(type)" - everything works fine.
- The problem: The main from has a property grid. I want it to use custom
type editor and a custom type converted that reside in myassembly.dll - you
do that by passing their assembly qualified name, which I do. The property
grid crashes!
- The solution
Change nothing but have a copy of myassembly.dll reside in the folder where
myapp.exe runs from (even if the dynamic assembly is being dynamically
loaded from its original path!!!) - when I do that, the property grid does
not crash on my custom type editor and type converter classes. It's like the
property grid only looks for the assembly in the current executable folder.
weird.
My question is: why do I need to have a copy of the myassembly.dll reside at
the myapp.exe folder for it to work.
Ron
"Chris Dunaway" <du******@gmail.comwrote in message
news:11*********************@h54g2000cwb.googlegro ups.com...
Ron M. Newman wrote:
>No project compile time reference is needed to my dynamic assembly DLL...
I load an assembly DLL dynamically with a complex path. the assembly DLL
is
NOT in the exutable folder.
I submit the fully qualified name to to the property grid (custom editor
etc.) and it FAILS.
How are you determining the fully qualified name? Are you doing it
from an instance of the class?
>although I have loaded the assembly DLL successfully from the other path.
how can I make sure it gets used correctly when things like the property
grid need to use it? it seems very strange to me that loading is
successful
from a "foreign" path, type instantiation works fine for all intents and
purposes, but only the damn property grid needs to have a copy of the
assembly DLL in the executable folder.
Can you post a short but complete program that demonstrates the
problem? It would make it much easier to triage the problem.
Chris