Dude, Where’s My Controls? (Visual Studio 2017 Behavior)

I’m coding along on the next release of SSIS Catalog Compare, happy as a clam, when I realize it’s time to add a new menu item. I open the form and… nothing.

To say my heart sank would be an understatement. I had questions. “Dude, where’s my controls?” “What happened?!” “Will I be able to recover?” “How long has this been going on?”

I react this way. It happens all the time and it concludes in a couple seconds. I think about it and often tell myself, “You are not the first person to encounter this issue.”

And then I search for the answer.

I found the answer in less than two minutes here.

The Problem

My designer code was no longer nested beneath the form You can see it here:

See that circled part in the image above? frmConfirmation.Designer.cs should be nested beneath the node above it named frmConfirmation.cs. It’s not, and that’s the problem. When I execute the code in the VS debugger the controls show up. I just can’t edit them.

The Solution

As two respondents mentioned in the link above, the solution is to exclude the Designer.cs file from the project:

Re-add it by right-clicking the project, hovering over Add, and then clicking Existing Item:

Navigate to the Designer.cs file and select it to re-add it to the solution:

This fixes the missing controls:

:{>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.