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. Visual Studio 10 Naming Issue?

Visual Studio 10 Naming Issue?

Scheduled Pinned Locked Moved C#
visual-studiohelpcsharpquestion
6 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
    PDTUM
    wrote on last edited by
    #1

    On occasion,when I am programing in VS 10, I will have an issue with a control, usually a button. Apparently I do something (I do not know what) and the application "loses" the original code behind a control and renames a new identical control with the name 1 after it. Case in point:

        private void buttonUsers\_Click\_1(object sender, EventArgs e)
        {
    
        }
    

    The original control is still there someplace and the code is intact, but the control no longer points to it. It points to the new blank definition instead. In the past, if it was a single issue (1 control) deal, I simply recoded the new button with the code from the old one and moved on, but this time, all the buttons on the page are gone. In fact, all the buttons in the application seem to be the same way. I think it is time to find out why. I hope that someone can tell me what I am inadvertently doing to cause this and how I can recover the application to where it was. I am at a loss...I appreciate your help...Thank You ... P

    E L 2 Replies Last reply
    0
    • P PDTUM

      On occasion,when I am programing in VS 10, I will have an issue with a control, usually a button. Apparently I do something (I do not know what) and the application "loses" the original code behind a control and renames a new identical control with the name 1 after it. Case in point:

          private void buttonUsers\_Click\_1(object sender, EventArgs e)
          {
      
          }
      

      The original control is still there someplace and the code is intact, but the control no longer points to it. It points to the new blank definition instead. In the past, if it was a single issue (1 control) deal, I simply recoded the new button with the code from the old one and moved on, but this time, all the buttons on the page are gone. In fact, all the buttons in the application seem to be the same way. I think it is time to find out why. I hope that someone can tell me what I am inadvertently doing to cause this and how I can recover the application to where it was. I am at a loss...I appreciate your help...Thank You ... P

      E Offline
      E Offline
      Emmanuel Medina
      wrote on last edited by
      #2

      I haven't experienced that kind of thing, and since you don't know how to reproduce this, I cannot help you on that front right now. Could you provide your solution files to see if we can reproduce your situation? also, try and do whatever you are doing regularly when this happens and take notice of all of it, try and give us the steps to reproduce your problem so we can help you figure out what is happening Now, regarding this:

      PDTUM wrote:

      how I can recover the application to where it was

      I can't think of anything to help you recover it to where it was, but you should always have some form of backup of your code. For future ocassions I would recommend using Source Code Control, even when working alone on a project, since you will have backups (preferably set the server on another machine) and you will be able to revert back to older versions of the code. If you have access to TFS (Team Foundation Server) that would be great since Team Explorer integrates pretty well with VS, if you don't try Subversion or TortoiseSVN, failing all that, zip up your code and put your zips (or RARs or whichever compressed format you prefer) in a safe place (i.e. cloud storage - SkyDrive, Google Drive, DropBox), my point here is, no matter how rudimentary (or sophisticated) but always have a backup of your work.

      P 1 Reply Last reply
      0
      • E Emmanuel Medina

        I haven't experienced that kind of thing, and since you don't know how to reproduce this, I cannot help you on that front right now. Could you provide your solution files to see if we can reproduce your situation? also, try and do whatever you are doing regularly when this happens and take notice of all of it, try and give us the steps to reproduce your problem so we can help you figure out what is happening Now, regarding this:

        PDTUM wrote:

        how I can recover the application to where it was

        I can't think of anything to help you recover it to where it was, but you should always have some form of backup of your code. For future ocassions I would recommend using Source Code Control, even when working alone on a project, since you will have backups (preferably set the server on another machine) and you will be able to revert back to older versions of the code. If you have access to TFS (Team Foundation Server) that would be great since Team Explorer integrates pretty well with VS, if you don't try Subversion or TortoiseSVN, failing all that, zip up your code and put your zips (or RARs or whichever compressed format you prefer) in a safe place (i.e. cloud storage - SkyDrive, Google Drive, DropBox), my point here is, no matter how rudimentary (or sophisticated) but always have a backup of your work.

        P Offline
        P Offline
        PDTUM
        wrote on last edited by
        #3

        Emmanuel, Thank you for your input. This happens semi often, but it never affected more than one control before. I wish I could reproduce it, but I cannot. I was hoping that you might have seen this and just knew what the heck it was that I did, not just for this time but for the next time. Anyway...I do have a backup of the app, but it will take me the better part of a day to get back to where I was...it happens that way sometimes. I appreciate the time and effort for your detailed response (and advice). Best Regards, Pat

        1 Reply Last reply
        0
        • P PDTUM

          On occasion,when I am programing in VS 10, I will have an issue with a control, usually a button. Apparently I do something (I do not know what) and the application "loses" the original code behind a control and renames a new identical control with the name 1 after it. Case in point:

              private void buttonUsers\_Click\_1(object sender, EventArgs e)
              {
          
              }
          

          The original control is still there someplace and the code is intact, but the control no longer points to it. It points to the new blank definition instead. In the past, if it was a single issue (1 control) deal, I simply recoded the new button with the code from the old one and moved on, but this time, all the buttons on the page are gone. In fact, all the buttons in the application seem to be the same way. I think it is time to find out why. I hope that someone can tell me what I am inadvertently doing to cause this and how I can recover the application to where it was. I am at a loss...I appreciate your help...Thank You ... P

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

          Check The Designer Class of your form and delete "buttonUsers", manually.

          P 1 Reply Last reply
          0
          • L Lost User

            Check The Designer Class of your form and delete "buttonUsers", manually.

            P Offline
            P Offline
            PDTUM
            wrote on last edited by
            #5

            Hello Smart...Thank you for your reply. I did not understand this, but I tried it anyway. It generated 11 errors and the application would no longer load generating the following response: "The variable "buttonUsers" was either never declared or was never assigned." I appreciate your effort. If you have another idea or if I did this wrong, please let me know. I suppose that I will have to go back and rebuild at least 12 hours of previous code to get back to where I was....Oh well. Best regards, Pat

            L 1 Reply Last reply
            0
            • P PDTUM

              Hello Smart...Thank you for your reply. I did not understand this, but I tried it anyway. It generated 11 errors and the application would no longer load generating the following response: "The variable "buttonUsers" was either never declared or was never assigned." I appreciate your effort. If you have another idea or if I did this wrong, please let me know. I suppose that I will have to go back and rebuild at least 12 hours of previous code to get back to where I was....Oh well. Best regards, Pat

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

              Hello, Hope this will help: 1-Find all "buttonUsers" in entire Solution. 2-Delete all of them. The Declaration The Delegate The Events 3-Open The From Designer and from Properties window Search for ButtonUsers, ( Manually ) if you find it Change it's Name to Something like "ButtonUsersXXX"and repeat Step 1 and step 2. 4- Build your Solution if you got an Error ( I hope you don't) Double click it, and post the line of the code which produce it here . Have a good day Sir.

              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