Re: Mixed code - Crashes in Release Mode

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Øystein Skotheim wrote:
Ben Voigt [C++ MVP] wrote:

Hello. I have problems with an applications consisting of mixed
native and managed code writted in C++/CLI in Visual Studio 2005.

The application runs fine in "Debug mode", however when I compile
the application in "Release" mode I run into the following
exception:
[...]

Does the problem occur when a debugger is attached? The information
you gave is from the point that the .NET framework catches the
exception and pretty low quality. With a debugger attached, you'll
trap the first-chance exception, at the point where the AV actually
occurs.

I run the program from within Visual Studio 2008 by clicking on "Start
debug". Is this what you mean? Then I can step through the code. When
I press F11 (Step Into) on the following code line, the exception
saying access violation appears immediately in the output window of
Visual Studio:
MeasureDialog = gcnew GcpsDialog();

even if I set a breakpoint on the first line of the constructor of
GcpsDialog. (A strange thing is that GcpsDialog is actually a part of
the main application and not a part of GcpsDotNetApi.dll - but the
dialog contains member variables that references into the DLL file -
so I guess this is the line of code that triggers loading of
GcpsDotNetApi.dll)

Turn on mixed debugging, and goto Debug menu > Exceptions and make sure that
Win32 exception "Access violation" is set to break when thrown.


.



Relevant Pages

  • Re: Mixed code - Crashes in Release Mode
    ... native and managed code writted in C++/CLI in Visual Studio 2005. ... The application runs fine in "Debug mode", ... exception and pretty low quality. ...
    (microsoft.public.vc.language)
  • Re: Deployment and DLLs
    ... An exception 'System.IO.FileNotFoundException' has occured in todo.exe ... You can debug your app after install. ... This call will result in VS debug dialog appear, attach with Visual Studio ... JS> a deployment setup file for. ...
    (microsoft.public.dotnet.general)
  • Re: Exception in CreateDialogIndirect when call DoModal in debug
    ... What kind of exception? ... debug mode, and of course it means the same bug exists in release mode, but it doesn't ... The problem is when i call the MeterDlg from DiagDlg. ...
    (microsoft.public.vc.mfc)
  • Re: Exception von MainForm wird im Release Build nicht gefangen
    ... Exception nach der Behandlung erneut wirfst. ... Im Debug mode fkt. ... nach wie vor das "Unbehandelte Ausnahme" - Fenster. ... Wie gesagt, im Debug funktioniert's. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Permission related / WebBrowser > System.UnauthorizedAccessException
    ... I cannot debug my app. ... An UnauthorizedAccessException exception is thrown when the operating system ... Web application in Visual Studio .NET, ... grant the worker process account the relevant ...
    (microsoft.public.dotnet.languages.vb)