Cannot load symbol for class project

Richard Gouette
Richard Gouette used Ask the Experts™
on
Trying to debug my Class project(VS.NET 2017)

When attaching to a process on my local box, the debug breakpoint tells me(attached)
I've tried ensuring the .pdb matches the compiled .dll
I've tried loading all symbols
I've tried "load symbols" by right clicking in module window on the relevant symbol, and when I browse to the .pdb, I am met with:
"A matching symbol file was not found in this folder"

I'm going to shoot myself soon...

please help!!
What are best practices for these symbol files?
Capture.PNG
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Hi Richard,

First and Foremost, Please don't shoot yourself :D...

On a serious note, are you sure the executable you are trying to debug was built with Debug options. It seems it was build with RELEASE options and optimizations were applied which will not allow you to debug easily.

Regards,
Chinmay.
Richard GouetteIT Manager

Author

Commented:
let me double check...
Richard GouetteIT Manager

Author

Commented:
well, it's set to 'Debug' for build mode, and  under Advanced Compiler Options, "Enable Optimizations is UNchecked.

Cleaned
Rebuilt
Made sure the .dll & .pdb were both stamped at the same time

In Modules window: .symbol is set to "Load Automatically"
Under Symbol locations, I've entered the path to the Debug folder & .pdb
Under Automatic Symbol loading preference:
"Load All modules , unless excluded.

I won;t shoot myself I promise, but man is this frustrating...
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
True... it is frustrating. Alright are there any other assemblies/projects on which your code depends(not the .Net framework one, but external one).

One more thing to check. Project Settings -> Build -> Advanced... -> Debug Info. What value you see there?
Richard GouetteIT Manager

Author

Commented:
under 'Compile' in project properties?
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
I think VS2017 uses Compile instead of build. If you can post a screenshot I can confirm.
Richard GouetteIT Manager

Author

Commented:
Capture.PNG
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Yupp. That's the one. And there is my answer, your project is generating debug info. One more thing, Can you please change Target CPU to 32-bit?
Richard GouetteIT Manager

Author

Commented:
done
cleaned, rebuilt
same message
;(
Richard GouetteIT Manager

Author

Commented:
hovering over the erroneous breakpoint gives:
Capture.PNG
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Do you see something like this in your code

#If(Debug)

Open in new window

Richard GouetteIT Manager

Author

Commented:
did a full solution search, only found a couple lines like:

#If _MyType = "WindowsForms" Then
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Is it possible for you to share your project? and the assembly you are trying to debug?
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
and just one more thing, does it hit any other breakpoints? or none at all?
Richard GouetteIT Manager

Author

Commented:
cleared all/any breakpoints
set one on a Try statement
perform "attach to process", browse down to my exe to attach to
the breakpoint changes to that annoying  yellow symbol you see above..

I wonder now if the telerik install messed ...something up?
Did that several weeks ago, but I may not have been in Debug since then..
Richard GouetteIT Manager

Author

Commented:
just had a thought to try & debug a forms app...
brb
Richard GouetteIT Manager

Author

Commented:
debugging a simple forms app works fine.
Is it possible that your Assembly is also installed in the GAC?
Write a testfile from that assembly just to make sure, that this is the one beeing loaded.
Richard GouetteIT Manager

Author

Commented:
The Global Assembly Cache contains the following assemblies:

Number of items = 0


I got that by using:  GACUTIL /L <my assemblyname>
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018
Commented:
Apart from Try did you try setting up/hitting any other debug point? Also, if possible do share your project I don't think this is a standard behavior. Another idea that I have used is, launch the exe you want to debug without the project or source or anything, attach the debugger and see what happens.
Could you please check your symbol options in visual studio, if everything is fine there?
SymbolOptions.JPG
Richard GouetteIT Manager

Author

Commented:
I enabled this path, as it's where the dll is initially compiled

Capture.PNG
And check with ProcessExplorer, if the image path of your assembly is correct by right click on the process of your application->properties and then .NET Assemblies.processexplorer.JPG
Clear the cache.
Richard GouetteIT Manager

Author

Commented:
had done that yesterday, but I'll do it again...standby
Richard GouetteIT Manager

Author

Commented:
I'm ok with sharing..
Upload a .zip of the project directory?
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Yes Please. I have been waiting for that 😈
Richard GouetteIT Manager

Author

Commented:
sorry...
;}

how do folks usually do that here, since it won;t allow a .vb etc to be uploaded?
e.g. upload a zip to dropbox or similar file hoster and post the link
Richard GouetteIT Manager

Author

Commented:
i dont got any issue. i referenced your project in another console app and was able to debug your classtest.JPG. just had to reference your and the p21 assembly. Are you sure that the image path of your assemblies is correct?
Richard GouetteIT Manager

Author

Commented:
is this the path to the DLL in Modules?
If so, it's different than the default compile path, as I have to copy the dll into another location for the vended app to
pick the dll up.
If I try & load the symbol from the default compile path, all I ever get is "A matching symbol file was not found..."

This is bizarre..
Yes, i changed the reference property copy local to true, just to have it in the output folder of the ConsoleApp. Is it possible to change your output folder to the directory, where your starting process assembly is located?
Richard GouetteIT Manager

Author

Commented:
ok, it's working.

I pointed my compile output path to  this 'alternate' directory mentioned above.. and it worked(deleted any instance of dll/pdb first)
There must be a reason why it doesn;t work to manually copy the DLL /pdb into this folder after compiling...
thanks so much for helping..
Rich
Richard GouetteIT Manager

Author

Commented:
many thanks for your time.
Rich
Your welcome.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial