System.AccessViolation in DllImport method after redeploy
Posted
by gall
on Stack Overflow
See other posts from Stack Overflow
or by gall
Published on 2010-04-03T18:44:25Z
Indexed on
2010/04/03
18:53 UTC
Read the original article
Hit count: 405
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);
}
© Stack Overflow or respective owner