I just tried to use a usercontrol I've been using in a variety of Framework applications. I get no errors, I add it to the designer file, set the properties, add it to the panel that it will be displayed on...and then it just quietly goes away. I never get a compiler error or anything like that. Even more interesting, it leaves the designer file incrementally.

In the designer file, there are four places that a control can be found.

1) There is the declaration, which is usually at the bottom of the .designer.vb file. This line looks like:

Code:
Friend WithEvents fsFishSlider As SlideFish
This is the one line that is never quietly deleted.

2) There is the place where the control is created, which is generally at the beginning of InitializeComponents(). The relevant line looks like this:

Code:
 Me.fsFishSlider = New SlideFish
At unpredictable times, this line simply vanishes.

3) There is the place where the control is added to the panel that holds it, which looks like:
Code:
Me.pFishNumbers.Controls.Add(Me.fsFishSlider)
At unpredictable times, this line also simply vanishes, sometimes with the control creation line, sometimes without it.

4) There is a block of property settings, which look like this:

Code:
 '
        'hsNumberOfFish
        '
        Me.fsFishSlider.LargeChange = 200
        Me.fsFishSlider.Location = New System.Drawing.Point(0, 216)
        Me.fsFishSlider.Maximum = 100000
        Me.fsFishSlider.Minimum = 0
        Me.fsFishSlider.Name = "fsFishSlider"
        Me.fsFishSlider.Size = New System.Drawing.Size(520, 25)
        Me.fsFishSlider.SmallChange = 100
        Me.fsFishSlider.TabIndex = 8
        Me.fsFishSlider.Value = 0
To be fair, I've used a variety of different property settings. Originally, I used a trackbar, then changed it over to be a SlideFish. This block tends to go away, as well.

None of these blocks ever show any errors, and the project builds without complaint. However, if I go over to look at the form, the panel is there, all the other controls are visible on the panel, but the slide fish doesn't show up. It doesn't show on the designer and it doesn't show as one of the controls on the form in the properties panel. Sometimes, just looking at the properties panel causes one or more of the blocks listed above to simply vanish from the designer file. I haven't seen any pattern as to which part vanishes.

If I try to look at the Document Outline view, that seems to wipe out all blocks from the designer.

The user control is defined in a dll that is targeting FW 4.5, so I thought that might be the problem. Therefore, I imported the user control into this project (which targets .NET5), but that didn't change the behavior. The user control builds just fine, but parts drop out of the designer file anyways.

The control is being quietly rejected, and I can't figure out why. Any suggestions?