System.AccessViolation in DllImport method after redeploy
- by gall
Hi Everyone,
My environment: Windows 2003, VS 2008, .NET 3.5 C# .NET application. During loading my application I call method from C++ dll (Knowl.dll) through my third-party dll library (Common.dll) written in C#. After first deploy (from VS to Developing server) evrything works fine. Then I stops Developing Server, doesn't any changes in code and redeploy. Throws AccessViolationException on this imported method. What is it? On second and after redeplies - the same error. Only after deletin source code and recheckout it from CVS I can normally start server.
Dll import:
[DllImport("Knowl.dll", EntryPoint = "GetBaseName")]
private static extern IntPtr getNameDll();
public static string GetName()
{
IntPtr p = IntPtr.Zero;
p = getNameDll();
return Marshal.PtrToStringUni(p);
}