Changes To Visual Studio 2005 Forms/Project Not Reflected at Runtime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gkinu
    New Member
    • Sep 2006
    • 22

    Changes To Visual Studio 2005 Forms/Project Not Reflected at Runtime

    I have a Visual Studio 2005 C# Windows application. I suddenly realized that when i changed the startup object to another form, the initial startup form would still be first to appear on running the application. I thought i would look at it later and opened a different C# solution that i am also working on. On this one, I made some changes to a form by placing controls on it. But the controls dont appear at runtime, although their visible property is correctly set to true. I try to set some breakpoints in code, but both solutions don't appear to recognize them. However, when i create a new solution, everything seems fine. Any ideas?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Where did you change the initial startup form?
    There should be something to the effect of:
    Code:
    Application.Run(new Form1());
    in the main() function.

    You would need to change that line to change what form is loaded at startup.

    Also, if ANY copies of the program are open (or "stuck" open, check your taskmanager) it will not actually finish BUILDing and your changes won't show up when you tell it to "run", you'll just have another copy of the old build running.

    Comment

    • vanc
      Recognized Expert New Member
      • Mar 2007
      • 211

      #3
      Originally posted by gkinu
      I have a Visual Studio 2005 C# Windows application. I suddenly realized that when i changed the startup object to another form, the initial startup form would still be first to appear on running the application. I thought i would look at it later and opened a different C# solution that i am also working on. On this one, I made some changes to a form by placing controls on it. But the controls dont appear at runtime, although their visible property is correctly set to true. I try to set some breakpoints in code, but both solutions don't appear to recognize them. However, when i create a new solution, everything seems fine. Any ideas?
      As Plater said, you should look at program.cs and change for initial form if you have only one project. The startup object is for another project in your solution.
      Cheers.

      Comment

      • gkinu
        New Member
        • Sep 2006
        • 22

        #4
        Originally posted by Plater
        Where did you change the initial startup form?
        There should be something to the effect of:
        Code:
        Application.Run(new Form1());
        in the main() function.

        You would need to change that line to change what form is loaded at startup.

        Also, if ANY copies of the program are open (or "stuck" open, check your taskmanager) it will not actually finish BUILDing and your changes won't show up when you tell it to "run", you'll just have another copy of the old build running.
        Thanks for your reply. I had actually checked the main() function. No problem there. I even restarted the IDE and the Laptop to no avail. Its now the second day and I have been forced to create another solution and imported the files. Everything works ok now, bugt I don't know for how long.

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Perhaps you could post some of the offending code?

          And have you looked in taskmanager to see if any copies of the program are still running?

          Comment

          • gkinu
            New Member
            • Sep 2006
            • 22

            #6
            Originally posted by Plater
            Perhaps you could post some of the offending code?

            And have you looked in taskmanager to see if any copies of the program are still running?

            There is no code in particular. Remember the problem is not only startup form, but even any changes i make is not reflected when i run the application e.g. I place new controls on the form, they wont be seen even though visible is set to true. When i place breakpoints in the code, its like they are not recognized.

            Comment

            • Plater
              Recognized Expert Expert
              • Apr 2007
              • 7872

              #7
              When you run in debug mode, do your breakpoints stay solid red or go hollow circles?
              Are you sure you are calling the right objects? And don't have multiple forms named "Form1" or something?

              Comment

              • gkinu
                New Member
                • Sep 2006
                • 22

                #8
                Originally posted by Plater
                When you run in debug mode, do your breakpoints stay solid red or go hollow circles?
                Are you sure you are calling the right objects? And don't have multiple forms named "Form1" or something?
                There is only one Form1. Breakpoints stay solid red.

                Anyway, i recreated a new solution and imported all the forms and other classes. Its working now, but old one still does not. So I would still be very intrerested to know what could have happened. And remember it also affected another completely different solution the same way!

                Thanks very much for your help.

                Comment

                Working...