I have a mixed language class library used for numerical modeling. It is C# calling a native DLL that is created using C++ wrapping Fortran libraries. My solution contains a unit testing project, from which I can debug from the C# into the C++ and Fortran. I have a specific unit test that compares modeling results with different class library. This second library has C# calling Fortran directly. It is this second library that is giving me a problem. I have been able to compile most of the DLLs for this second library in debug mode using "Enable native code debugging" for the C# projects. I have also enabled "Just my code" to avoid debugging through Microsoft code. I can step from my unit test into the C# layer of the second library. When I get to the only Fortran call, my step into just steps over. After the step over, but not before, I can see the Fortran DLL I am trying to step into in the modules window. It is listed as user code and the pdb file is correctly referenced. I have forced the debugger to run the Fortran a second time, but it still will not step in. I have run out of ideas on what to check to get the debugging to work.
I have not included the projects from the second library into my solution. I am just pulling the compiled DLLs from a directory.
I am using VS2019 16.11.18 and Intel Fortran 2019.6.324
Edit: Some details.
I have not included the code from the second library in my solution because it uses Fortran source which has been modified from my original source and is incompatible. The team that modified it did not consider compatibility with other users and applications.
Update 6/13/2023:
I took the code from my unit test and created a simple application. It has a run button, so I can start the program separately from running the numerics, and a console to monitor output. I have tried starting the program and then using debug -> attach from the class library. I can then run the calculation and see the debugger step though the C# in the library, but it won't step into the Fortran. I did put break points in the Fortran. When I mouse over them, it says that symbols are not loaded. It is debug mode and debug native code is enabled.
I finally came up with a resolution. Instead of running a unit test from my library solution, I created a unit test project in the solution containing the DLLs I needed to debug. In addition to the unit test, I had to move 42 classes from my library into the new unit test project. Once I had the unit test building correctly, I found that I had to hand copy 3 Intel Fortran DLLs into the folder where the unit test was running, each time I ran it. The final piece of the puzzle was that I had to run Visual Studio in admin mode. This is not something I had to do when debugging into native code in my own solution. I do not know why admin mode is required.