Hello all,
I've got a project that pinvokes an unmanaged DLL and everything runs smoothly with it.
The problem begins when I publish the project and install it on a different computer- I get the DllNotFoundException when it's being called, and the oddest thing is that the message says the dll wasn't found on the project's bin\debug path. The problem is that I wish to have the dll on the application startup path, but cannot use Application.StartupPath within the DllImport Attribute, since it takes only consts. Does anyone know why does the application search for the dll in the bin\debug folder Is there anyway to change this (I've tried adding the app startup path to the environment path, didn't work) Or better yet, is there a way of using the Application.StartupPath when using the DllImport Attribute

DllNotFoundException- path problems
JohnG1007
krig
R.Tutus
I came across this sample of yours, suggesting to use System.Reflection.Emit in order to set dll path at runtime. Could this be what I was after
Darius R
the attribute is very simple:
[DllImport("MyDll.dll", EntryPoint = "MyMethod")]Prerak Shah
nobugz- I've found out the walker wasn't profiling actually since there were a couple of problems- on dll missing (which i've solved by removing IE7 from my machine), and now there's MPR.DLL that is in red and the message says:
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
The walker still doesn't profile- any ideas
pink_flower4love
Indeed, this dll needs another dll, but I made sure before testing that they are both present in the same folder, so I honestly don't think the problem is there. So, in fact the app was supposed to look for this dll in the application exe folder Could it be that it has something to do with the signing or the use deploy file extension I've been trying to work around this all day yesterday, and still I haven't the slightest idea...
Sachin Samuel
00:00:00.235: Exited "c:\Application path\MyApp.EXE" (process 0x20C) with code -1073740791 (0xC0000409) by thread 1.
and the profiling process is stopped. This actually happens with the published application as well as with the .exe file in the bin\Debug folder of the (unpublished) project.
chuckdawit
Karlo
Hena
Harisingh Rajput
I play about with the app so that the missing dlls will be called, still nothing in the Walker's log view... Arrrrggghhhh :p