I have a .dll that I generated thorugh a C++ project. I have to use this dll in my ASP.NET project and I have written DllImport functions for the same in my project.
The static class inside App_Code
has some DllImport
functions
public static class Functions
{
[DllImport("MyFav.dll", EntryPoint = "fnmain",
CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public static extern StringBuilder fnmain();
}
Since I could not add the C++ dll directly as a reference in my ASP.NET project (because it is not a .NET assembly), I just copied into the top level directory. ( Name of ASP.NET Project-> Right Click -> Add Existing Item )
Now, when I try to run the project, I get the following error:
Exception:
Unable to load DLL 'MyFav.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Any suggestions? Where has the .dll to be kept?