Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Tracking down bugs in XAML

Tracking down bugs in XAML

Scheduled Pinned Locked Moved WPF
wpfdebugginghelpquestion
9 Posts 3 Posters 16 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jammer 0
    wrote on last edited by
    #1

    Hi All, Does anyone have any tips on tracking down hard to find problems in XAML? My application runs without any hitches and everything works as designed. Blend opens the solution and displays the main window with out any errors or problems building the solution. But VS2008 wont show the main screen in its XAML designer pane and says that there is an un-handled exception "Object reference not set to an instance of an object." I've seen this error and solved it before but the exception track trace gives no clue as to the source of the exception. Thanks,

    Jammer Going where everyone here has gone before! :) My Blog

    L P 2 Replies Last reply
    0
    • J Jammer 0

      Hi All, Does anyone have any tips on tracking down hard to find problems in XAML? My application runs without any hitches and everything works as designed. Blend opens the solution and displays the main window with out any errors or problems building the solution. But VS2008 wont show the main screen in its XAML designer pane and says that there is an un-handled exception "Object reference not set to an instance of an object." I've seen this error and solved it before but the exception track trace gives no clue as to the source of the exception. Thanks,

      Jammer Going where everyone here has gone before! :) My Blog

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Jammer, 1. build often so that things don't creep in. 2. I've seen this too. Blend likes this, VS doesn't. Also in the reverse. 3. To find your problem, open in VS and remove sections one at a time until the offending section is discovered. Then, go look at the constructors for code and controls in the offending section. You really need to watch code in your constructors as if it blows up, you get "REAL" misleading exception messages. Hope this helps.

      Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

      Just a grain of sand on the worlds beaches.

      J 1 Reply Last reply
      0
      • L Lost User

        Jammer, 1. build often so that things don't creep in. 2. I've seen this too. Blend likes this, VS doesn't. Also in the reverse. 3. To find your problem, open in VS and remove sections one at a time until the offending section is discovered. Then, go look at the constructors for code and controls in the offending section. You really need to watch code in your constructors as if it blows up, you get "REAL" misleading exception messages. Hope this helps.

        Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

        Just a grain of sand on the worlds beaches.

        J Offline
        J Offline
        Jammer 0
        wrote on last edited by
        #3

        Yeah, i builld really often ... in fact almost constantly as I'm still really feeling my way around .NET in general. I have a couple of ideas as to what might be doing it ... I need to investigate these. I think your idea of removing sections (do you mean controls and use controls?) will be a good one ... Do you know of any plans by the WPF team to tighten the grip on XAML exceptions like this? I was chatting to another Developer at work today (a contractor) and he was expressing similar feelings about how difficult it can be to track down XAML problems.

        Jammer Going where everyone here has gone before! :) My Blog

        L 1 Reply Last reply
        0
        • J Jammer 0

          Yeah, i builld really often ... in fact almost constantly as I'm still really feeling my way around .NET in general. I have a couple of ideas as to what might be doing it ... I need to investigate these. I think your idea of removing sections (do you mean controls and use controls?) will be a good one ... Do you know of any plans by the WPF team to tighten the grip on XAML exceptions like this? I was chatting to another Developer at work today (a contractor) and he was expressing similar feelings about how difficult it can be to track down XAML problems.

          Jammer Going where everyone here has gone before! :) My Blog

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Jammer wrote:

          Do you know of any plans by the WPF team to tighten the grip on XAML exceptions

          Have not heard of any specific rumblings, which is why I build often and learn the do's and don'ts. Comes with time, you'll get it all sorted out. :-D

          Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

          Just a grain of sand on the worlds beaches.

          J 1 Reply Last reply
          0
          • J Jammer 0

            Hi All, Does anyone have any tips on tracking down hard to find problems in XAML? My application runs without any hitches and everything works as designed. Blend opens the solution and displays the main window with out any errors or problems building the solution. But VS2008 wont show the main screen in its XAML designer pane and says that there is an un-handled exception "Object reference not set to an instance of an object." I've seen this error and solved it before but the exception track trace gives no clue as to the source of the exception. Thanks,

            Jammer Going where everyone here has gone before! :) My Blog

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Unfortunately, the issue with the designer pane reporting an unhandled exception is consistent with the behaviour of the old WinForms designer. The problem actually relates to the designer having to "compile and interpret" the item in the designer, and some things just go wrong. I usually find that attempting a clean rebuild is a good idea in order to find issues.

            Deja View - the feeling that you've seen this post before.

            My blog | My articles

            J 1 Reply Last reply
            0
            • L Lost User

              Jammer wrote:

              Do you know of any plans by the WPF team to tighten the grip on XAML exceptions

              Have not heard of any specific rumblings, which is why I build often and learn the do's and don'ts. Comes with time, you'll get it all sorted out. :-D

              Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | How To Create Screen Capture Videos For Your Articles

              Just a grain of sand on the worlds beaches.

              J Offline
              J Offline
              Jammer 0
              wrote on last edited by
              #6

              For sure ... nothing beats experience. I have my data loading and saving via my custom dialog now ... all looking very WPF and spanky new sparkly nice ... :) Just trying to find out where the Serialization exceptions live now ...

              Jammer Going where everyone here has gone before! :) My Blog

              1 Reply Last reply
              0
              • P Pete OHanlon

                Unfortunately, the issue with the designer pane reporting an unhandled exception is consistent with the behaviour of the old WinForms designer. The problem actually relates to the designer having to "compile and interpret" the item in the designer, and some things just go wrong. I usually find that attempting a clean rebuild is a good idea in order to find issues.

                Deja View - the feeling that you've seen this post before.

                My blog | My articles

                J Offline
                J Offline
                Jammer 0
                wrote on last edited by
                #7

                Hi Pete, A clean rebuild? Do you mean run a "Clean Solution" and then rebuild/recompile? Cheers,

                Jammer Going where everyone here has gone before! :) My Blog

                P 1 Reply Last reply
                0
                • J Jammer 0

                  Hi Pete, A clean rebuild? Do you mean run a "Clean Solution" and then rebuild/recompile? Cheers,

                  Jammer Going where everyone here has gone before! :) My Blog

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  Jammer wrote:

                  A clean rebuild? Do you mean run a "Clean Solution" and then rebuild/recompile?

                  I certainly do.

                  Deja View - the feeling that you've seen this post before.

                  My blog | My articles

                  J 1 Reply Last reply
                  0
                  • P Pete OHanlon

                    Jammer wrote:

                    A clean rebuild? Do you mean run a "Clean Solution" and then rebuild/recompile?

                    I certainly do.

                    Deja View - the feeling that you've seen this post before.

                    My blog | My articles

                    J Offline
                    J Offline
                    Jammer 0
                    wrote on last edited by
                    #9

                    Feck ... that didn't help at all. I need to sit down with more time for tackling this one. :(

                    Jammer Going where everyone here has gone before! :) My Blog

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups