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. C#
  4. Magical persistence

Magical persistence

Scheduled Pinned Locked Moved C#
debuggingcsharpdatabasevisual-studiohelp
7 Posts 3 Posters 0 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.
  • P Offline
    P Offline
    Peter Trevor
    wrote on last edited by
    #1

    I have a peculiar bug that's got me baffled. I'm working on a C# winform app in VS2005 and I was trying to make one of its menus dynamic (built from data read from a database). Somewhere along the line the new menu items became doubled so I tried to reverse out the code changes. But no matter what I did these new menu items persisted. I've removed all new code. I've deleted the form's resx. I've emptied the obj and bin directories. I've rebooted my PC. I've saved the form's code in a notepad session, the designer code in another notepad session, deleted the form, then recreated it from the two notepad sessions. The find function cannot locate the text of the new menu items, nor does anything reveal itself when stepping through in debug. No trace shows in the IDE designer. Yet somehow when I run the program there they are! How is this possible? Where is this being persisted? The workaround was to change the parent menu's ID string, so its not urgent ... but I'd still like to understand what's going on.

    L H P 3 Replies Last reply
    0
    • P Peter Trevor

      I have a peculiar bug that's got me baffled. I'm working on a C# winform app in VS2005 and I was trying to make one of its menus dynamic (built from data read from a database). Somewhere along the line the new menu items became doubled so I tried to reverse out the code changes. But no matter what I did these new menu items persisted. I've removed all new code. I've deleted the form's resx. I've emptied the obj and bin directories. I've rebooted my PC. I've saved the form's code in a notepad session, the designer code in another notepad session, deleted the form, then recreated it from the two notepad sessions. The find function cannot locate the text of the new menu items, nor does anything reveal itself when stepping through in debug. No trace shows in the IDE designer. Yet somehow when I run the program there they are! How is this possible? Where is this being persisted? The workaround was to change the parent menu's ID string, so its not urgent ... but I'd still like to understand what's going on.

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Have you checked the content of the database? :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


      P 1 Reply Last reply
      0
      • P Peter Trevor

        I have a peculiar bug that's got me baffled. I'm working on a C# winform app in VS2005 and I was trying to make one of its menus dynamic (built from data read from a database). Somewhere along the line the new menu items became doubled so I tried to reverse out the code changes. But no matter what I did these new menu items persisted. I've removed all new code. I've deleted the form's resx. I've emptied the obj and bin directories. I've rebooted my PC. I've saved the form's code in a notepad session, the designer code in another notepad session, deleted the form, then recreated it from the two notepad sessions. The find function cannot locate the text of the new menu items, nor does anything reveal itself when stepping through in debug. No trace shows in the IDE designer. Yet somehow when I run the program there they are! How is this possible? Where is this being persisted? The workaround was to change the parent menu's ID string, so its not urgent ... but I'd still like to understand what's going on.

        H Offline
        H Offline
        Henry Minute
        wrote on last edited by
        #3

        Without seeing your code, I wouldn't know a definitive answer (I probably wouldn't have one, even after seeing your code either :) ), but is there any chance that your routine is being called twice?

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        P 1 Reply Last reply
        0
        • H Henry Minute

          Without seeing your code, I wouldn't know a definitive answer (I probably wouldn't have one, even after seeing your code either :) ), but is there any chance that your routine is being called twice?

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          P Offline
          P Offline
          Peter Trevor
          wrote on last edited by
          #4

          Nope. I've commented out large swathes of code so that now all that happens is the form's constructor calls InitialiseComponents. I've verified this by stepping through every line in debug. Additionally, while the text of the original menus can be found using the IDE's search function, the text of the 'magical' menus cannot be found.

          1 Reply Last reply
          0
          • L Luc Pattyn

            Have you checked the content of the database? :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.


            P Offline
            P Offline
            Peter Trevor
            wrote on last edited by
            #5

            I can't see anything suspicious in the database. Besides, all access is screened through stored procedures and I never coded for menus to be stored or retreived from the database (just a simple function that returned a list of strings from which the 'magical' menus were built - that code has since been removed). But just to be sure I took the database offline: the 'magical' menus still appear.

            1 Reply Last reply
            0
            • P Peter Trevor

              I have a peculiar bug that's got me baffled. I'm working on a C# winform app in VS2005 and I was trying to make one of its menus dynamic (built from data read from a database). Somewhere along the line the new menu items became doubled so I tried to reverse out the code changes. But no matter what I did these new menu items persisted. I've removed all new code. I've deleted the form's resx. I've emptied the obj and bin directories. I've rebooted my PC. I've saved the form's code in a notepad session, the designer code in another notepad session, deleted the form, then recreated it from the two notepad sessions. The find function cannot locate the text of the new menu items, nor does anything reveal itself when stepping through in debug. No trace shows in the IDE designer. Yet somehow when I run the program there they are! How is this possible? Where is this being persisted? The workaround was to change the parent menu's ID string, so its not urgent ... but I'd still like to understand what's going on.

              P Offline
              P Offline
              Peter Trevor
              wrote on last edited by
              #6

              Another piece of the puzzle: whatever is bringing back these dynamic menus (that I no longer create but still appear) is happening after the form's Load method has run and before the first time the form's Activate method is run. (This was determined by stepping through the code and looking at the number of submenus listed in the IDE's "Locals" window on the last line of the Load and the first line of the Activate ... 14 submenus had been added between these two points.)

              P 1 Reply Last reply
              0
              • P Peter Trevor

                Another piece of the puzzle: whatever is bringing back these dynamic menus (that I no longer create but still appear) is happening after the form's Load method has run and before the first time the form's Activate method is run. (This was determined by stepping through the code and looking at the number of submenus listed in the IDE's "Locals" window on the last line of the Load and the first line of the Activate ... 14 submenus had been added between these two points.)

                P Offline
                P Offline
                Peter Trevor
                wrote on last edited by
                #7

                Okay, I've found the root of the problem. Even though this thread is now old I figure I should post here anyway in case someone gets a similar problem and finds this thread in a Google search. (Don't you just hate googling for a problem and find loads of other people asking the same questions years before and then they stop without telling you what solution they eventually used?) The third party controls I was using were placing data in Isolated Storage. Specifically (on Vista) ...

                AppData
                /Local
                /IsolatedStorage
                /(gibberish)
                /(gibberish)
                /Url.(gibberish)
                /StrongName.(gibberish)
                /Files
                /SyncfusionToolsStateInfo.bin.

                This file had become corrupted. According to the component authors deleting this file should solve the problem (a new version is recreated). However, in my case my Windows set up had become unstable so I reinstalled the whole of Windows instead. Regardless, Isolated Storage is another place to look when you have these kinds of problems. (I hope this helps somebody, someday.)

                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