views:

376

answers:

4

for some reason, my visual studio 2010 is not loading debug symbols on my own code.

i am using a default WPF application solution. with a sample WPF app i am working on, and running in Debug mode.

when i go into debug, i can step through my code.

BUT

when exception happens in my code (i.e. throw new Exception("test")), visual studio gives me the blue blank screen with "No Source Available. No symbols are loaded blah blah.."

AND

i can actually "view" exception details, where it will tell me the line of code my exception occured on.

so it does know what happened.. it seems.

it seems to think that PDB files are not loaded.

my setup:

options > Deubg > "Enable just my code (managed only)" is checked. application properties : 1 project running in Debug x86

A: 

Too bad no one has replied to this question. I was seeking an answer to this exact same question, so have been monitoring this for answers.

I get the feeling that Visual Studio could simply be at fault here (with regard to development in WPF). "No Source Available. No symbols are loaded" just seems to be a flat out wrong message, that something is getting in the way of VStudio properly breaking at the exception within the code, especially when it clearly already knows where the error is. It is a very big problem I think, it really hinders WPF development. Hoping for improvements in the future!

im not sure if everyone has this problem..
Sonic Soul
A: 

Hi

I was also facing this issue and luckily find out following solution.

If you do not want to debug .NET assembly, a quick fix to avoid "No source available to current location" problem is to uncheck "Require source files to exactly match the original version" check-box under Tool -> Options -> Debugging -> General

Please let me know, if it solves your problem.

Thanks Shilpa

Shilpa Silk
A: 

Tried Debugging answer and didn't have any luck. What I think happened, in my case...

I renamed some files/namespaces/etc during a cleanup and my App.xaml was pointing to a now non-existant namespace.

This is what I had in my code:

    <Application x:Class="Patcom.App"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 StartupUri="SomethingElse.xaml"
                 xmlns:p="clr-namespace:Patcom.Properties">
   ....
   </Application>  

This is what I needed in my code (Notice the changed StartupUri in my case):

<Application x:Class="Patcom.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="Patcom.xaml"
             xmlns:p="clr-namespace:Patcom.Properties" >
....
</Application> 

No clue if this is remotely your case. I'm still very noobish and there isn't a whole lotta information in your post... but i found this while searching for the same problem on my code.

Further Notes: After more research... I found another post claiming that the problem really lies with date-stamps on objects in the Bin & Obj directories becoming out of sync between multiple "projects" in the same solution.

I don't have the link anymore, but what I've ended up doing is deleting Bin & Obj directories. We'll see shortly if I have the same problems on my work computer that I had on my home computer.

WernerCD
A: 

Loading symbols should be configured on : Tools -> Options -> Debugging -> Symbols where you can choose to Automatically load symbols for: "All modules" or "Only specified modules". This should be set to all modules. If you get "no source available" for exceptions in the .NET framework like I did you should hit the "empty symbol cache" button. This worked for me.

Bart