User Controls disappear

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Polen

    #1

    User Controls disappear

    I create a user control (actually a several). Everything
    is fine. I use it on a form or two. Everything is fine.
    All of a sudden when I make a change and rebuild, it can't
    find the control anymore. SAME PROBLEM OCCURS WITH C# OR
    VB.NET???????

    Error Message:
    The user control ... could not be loaded. Ensure that the
    library containing the control has been built and a
    project reference has been made to the library containg
    the control. If you have changed the name of the user
    control, close and re-open the control's designer to
    update the toolbox item

    I didn't do anything that I can figure. The controls are
    in the same namespace and project as the mainline.
  • Vijaye Raji

    #2
    Re: User Controls disappear

    Are your user controls in the same solution as the main project?

    Is "Copy Local" set to true for the references?

    Can you give more info about "All of a sudden when I make a change and
    rebuild"... where is this change made - to the User control or the main
    project?

    - VJ

    "Michael Polen" <mike@thepolens .com> wrote in message
    news:237501c367 9e$40e159f0$350 1280a@phx.gbl.. .[color=blue]
    > I create a user control (actually a several). Everything
    > is fine. I use it on a form or two. Everything is fine.
    > All of a sudden when I make a change and rebuild, it can't
    > find the control anymore. SAME PROBLEM OCCURS WITH C# OR
    > VB.NET???????
    >
    > Error Message:
    > The user control ... could not be loaded. Ensure that the
    > library containing the control has been built and a
    > project reference has been made to the library containg
    > the control. If you have changed the name of the user
    > control, close and re-open the control's designer to
    > update the toolbox item
    >
    > I didn't do anything that I can figure. The controls are
    > in the same namespace and project as the mainline.[/color]


    Comment

    • Michael Polen

      #3
      Re: User Controls disappear

      1. Yes, the controls are in the same solution.
      2. What is "Copy Local?" How do I set it?
      3. I can make a change to any of the controls or try to change the main
      by just adding a control to it. All of a sudden some or all of my
      controls no longer appear in the namespace.
      [color=blue][color=green]
      >>Are your user controls in the same solution as the main >>project?[/color][/color]
      [color=blue][color=green]
      >>Is "Copy Local" set to true for the references?[/color][/color]
      [color=blue][color=green]
      >>Can you give more info about "All of a sudden when I make >>a change[/color][/color]
      and[color=blue][color=green]
      >>rebuild"... where is this change made - to the User >>control or the[/color][/color]
      main[color=blue][color=green]
      >>project?[/color][/color]
      [color=blue][color=green]
      >>- VJ[/color][/color]



      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Vijaye Raji

        #4
        Re: User Controls disappear

        Click on the reference to your user control in your main project, and see
        the properties. You'll have a property named "Copy Local". Set it to true.
        I'm not sure if this is the problem, but it's worth a try.

        Also, do you have the output directory for both the projects set to the same
        directory?

        - VJ

        "Michael Polen" <mike@thepolens .com> wrote in message
        news:Ow8nam$ZDH A.2580@TK2MSFTN GP12.phx.gbl...[color=blue]
        > 1. Yes, the controls are in the same solution.
        > 2. What is "Copy Local?" How do I set it?
        > 3. I can make a change to any of the controls or try to change the main
        > by just adding a control to it. All of a sudden some or all of my
        > controls no longer appear in the namespace.
        >[color=green][color=darkred]
        > >>Are your user controls in the same solution as the main >>project?[/color][/color]
        >[color=green][color=darkred]
        > >>Is "Copy Local" set to true for the references?[/color][/color]
        >[color=green][color=darkred]
        > >>Can you give more info about "All of a sudden when I make >>a change[/color][/color]
        > and[color=green][color=darkred]
        > >>rebuild"... where is this change made - to the User >>control or the[/color][/color]
        > main[color=green][color=darkred]
        > >>project?[/color][/color]
        >[color=green][color=darkred]
        > >>- VJ[/color][/color]
        >
        >
        >
        > *** Sent via Developersdex http://www.developersdex.com ***
        > Don't just participate in USENET...get rewarded for it![/color]


        Comment

        • Michael Polen

          #5
          Re: User Controls disappear

          Yes, there is only one directory involved.
          I can't find a copy local property anywhere.
          [color=blue][color=green]
          >>Click on the reference to your user control in your main >>project,[/color][/color]
          and see[color=blue][color=green]
          >>the properties. You'll have a property named "Copy >>Local". Set it to[/color][/color]
          true.[color=blue][color=green]
          >>I'm not sure if this is the problem, but it's worth a try.[/color][/color]


          Mike Polen
          4 year of programming experience spread over 4 decades -- who remembers
          1401 autocoder?

          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Paul E Collins

            #6
            Re: User Controls disappear

            "Michael Polen" <mike@thepolens .com> wrote:
            [color=blue]
            > I create a user control (actually a several).
            > [...]
            > All of a sudden when I make a change and
            > rebuild, it can't find the control anymore.[/color]

            When the controls and application are in the same solution, this can happen
            if you rebuild the solution and part of the rebuild fails (e.g. a syntax
            error). If this is the case, you just have to fix the problem and rebuild
            before trying to open any of the forms in design view.

            P.

            --



            Comment

            • M Polichek

              #7
              Re: User Controls disappear

              Paul
              That would make sense if I was getting any other errors. Buy the build
              says successful with no errors. Sometimes I can't even add the control
              to the main form. It acts like it does when you create a new control and
              try to add it to the form without first building.

              Mike
              [color=blue][color=green][color=darkred]
              >>>When the controls and application are in the same solution, this can[/color][/color][/color]
              happen if you rebuild the solution and part of the rebuild fails (e.g. a
              syntax error). If this is the case, you just have to fix the problem and
              rebuild before trying to open any of the forms in design view.
              <<<

              MP
              4 year of programming experience spread over 4 decades -- who remembers
              1401 autocoder?

              *** Sent via Developersdex http://www.developersdex.com ***
              Don't just participate in USENET...get rewarded for it!

              Comment

              Working...