I'm sure I'm missing something basic.
I have an class library that uses an unmanaged dll.
Let's say the class library is called "CL1.dll" and is located at:
[c:\temp\CL\CL1.dll]
and the unmanaged dll is called "UM.dll" and is located at [c:\temp\UM.dll]
For my DllImport attribute I was using [DllImport("c:\temp\UM.dll")] and
this worked.
Now I want to setup my installer so I can deploy this app and I realize that
I can't hard code the path like that. So I tried copying [UM.dll] to
[c:\temp\CL\] thinking that if it was in the same directory as CL1.dll it
would find it if I did this: [DllImport("UM.dll")]
no luck. Throws an exception saying it can't find it.
Then I thought I might still need to supply the full path, so I tried using
the Assembly class to get the executing path oc CL1.dll. This doesn't work
because DllImport needs a const string.
so.. how do I do this? Seems like it should be easy, but it's beating me...
:(
Thanks,
Steve