I know you need to turn on the 'Native Code' debugger in order to step into the pinvoke'd dll, however I am not even getting to that point. Instead, when I try to step into the dll I am getting the following exception
"Unable to load DLL 'Native.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
If I check my modules I see that the current .Net dll I am in is located in: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\project\c4e2b8a9\1234a123\assembly\d12\de123456\12345678_0304cb01\dotnet.dll
So it makes sense that I am not finding my pinvoked dll, as it does not exist in this path. How can I make it so that when my code is run from the 'Temporary ASP.Net files' location, it will see my pinvoked dll? (Without hardcoding the path).
Current my decleration is as follows:
[DllImport("Native.dll")]
public static extern int RunTest();
Edit:
I found a similar question with some good suggestions. http://stackoverflow.com/questions/344608/unmanaged-dlls-fail-to-load-on-asp-net-server