Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
27996 Discussions

Visual Studio doesn't break for Fortran run-time error (SOLVED)

New Contributor II

I have solved this, but thought it was worth a post as I didn't find a fix online.

Using Visual Studio 2019, Intel Fortran 2019U5 on Windows 10.  The application is a C# WPF main calling a Fortran DLL.

When debugging with /check:bounds or /check:shape, I got a pop-up window with "Visual Fortran run-time error" but Visual Studio no longer broke at the line of code with the error.  It used to work, but since then I had upgraded VS and made other changes.

I eventually found that the problem was the Visual Studio exception handling settings.  In Debug > Window > Exception Settings I need to (re)set to break when Win32 Exception 0xC0000005 Access Violation is thrown.  This would be a useful addition to the manual.  Perhaps a note documenting which exceptions are raised and the importance of catching them in the development environment.

Root cause was a colleague who had fiddled with the settings and committed the change to the VS project.

0 Kudos
0 Replies