'How to find from where the dll is loaded when we use DllImport

I'm using DllImport in my C# code to invoke a function from a dll. I register this dll using regsvr32 command and all works good. Then I unregister the dll and deleted it. But still my code works. Later I found that I have a copy of the same dll in C:\Windows\System32 directory. I may have this dll path added in system environment path. My question is how can I find, from which loacation the dll is loaded?

This is how I use DllImport in my code

[DllImport("abcd.dll", CharSet = CharSet.Auto, SetLastError = true, CallingConvention = CallingConvention.Cdecl)]
    [return: MarshalAs(UnmanagedType.Bool)]
    private static extern bool CanStart();


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source