Click here to Skip to main content
15,307,117 members
Please Sign up or sign in to vote.
0.00/5 (No votes)

I have a native c++ app. that uses a clr/cli wrapper to call a c# dll function.

The solution is built in VS.2017, using the platform toolset of vs2010(v100) and includes the native c++ project, the clr/cli wrapper project and the
c# dll project.

The 1st time I call the wrapper function an exception is thrown that says that the wkernelbase.pdb not loaded - if I step out from it the wrapper function is completed successfully and all the next calls to the same function doesn't cause the exception to be thrown again.

The wrapper is a clr/cli lib. that exports a function that calls a function from a c# dll.

My c++ native app. has a reference to the clr/cli lib and the c# assembly (it can be seen under the references in the solution explorer), it also of course, includes the wrapper lib. under the Additional Dependencies.

Can I ignore this exception? does the excpetion purpose is only to notify me that it cant find the wkernel.pdb file? (The app. runs offline so I cant use the Microsoft symbols server and the file doesn't exist on my system) and if its the case how can I make vs2017 stop throwing this exception
for the 1st function call?

Thank you all in advance


What I have tried:

Googling the problem. Changing the Debugger type under the Project Configuration Properties to Mixed/Auto.
Updated 19-May-21 8:54am
Richard MacCutchan 19-May-21 10:31am
Is that really an exception? It should just be a debugger message to tell you that it cannot find the debug file for the wkernelbase library.
dj4400 19-May-21 11:07am
When it happens a tab with the caption "No symbols loaded" is opened and in that tab
the title is "wkernel.pdb not loaded". But above this tab, a form that its caption says "Exception Thrown" is opened and on it the exception details appear and exception settings options appear
Richard MacCutchan 19-May-21 11:09am
That suggests that you are trying to use the debugger to step into some code that cannot be viewed.
dj4400 20-May-21 3:26am
I checked and in the native c++ app. I can't step into the clr/cli wrapper code and can't step into the c# code (it doesn't stop even I insert there a breakpoint), although the code of both of the projects is a part of the solution.

1 solution

That's not an exception. It's just a debugger message that says it cannot load the symbols from the PDB file for the wkernelbase assembly. There's nothing to worry about there.

If you want to get rid of it, you can enable automatically downloading the symbol files from Microsoft's Symbol Server.

Go to Tools -> Options -> Debugging -> Symbols -> then check the box next to "Microsoft Symbol Servers".

Fill in the textbox for "Symbol cache directory" with a path to store the downloaded symbol files. I typically use C:\Symbols.

Hit OK and run your app.
dj4400 20-May-21 3:20am
Thanks for your reply

I am working offline so I cant download from the Microsoft server.

I tried calling the clr/cli function in a separate tester app. that I have built just for that and in the tester I didn't got the above mentioned message

I migrated the c# and clr/cli projects from the tester to the target app. but I still got that message
Dave Kreskowiak 20-May-21 10:12am
Tools -> Options -> Debugging -> General -> Make sure "Enable Just My Code" is checked.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900