Code-Behind in Designer.cs File [SOLVED]
-
Using Visual Studio 2022 latest build. EDIT: This is not a .NET Framework project, it's a .NET core Windows Forms project, or whatever it's called. I have a situation where I've added a bunch of controls to a form, but Visual Studio is not updating the Designer.cs file with the new controls. The controls all exist as I placed them on design canvas, but when I compile the project, the controls don't appear in the EXE because the Designer.cs file is not synchronized with the canvas. Question: How can I force Visual Studio to rewrite the Designer.cs file so that all the controls that I added are accounted for? I'd rather not remove the form from the project and add it back because I'd lose all the work I did to place the controls. Any assistance is greatly appreciated! SOLUTION: I was able to fix it by removing the project from the solution and then adding it back.
The difficult we do right away... ...the impossible takes slightly longer.
-
Using Visual Studio 2022 latest build. EDIT: This is not a .NET Framework project, it's a .NET core Windows Forms project, or whatever it's called. I have a situation where I've added a bunch of controls to a form, but Visual Studio is not updating the Designer.cs file with the new controls. The controls all exist as I placed them on design canvas, but when I compile the project, the controls don't appear in the EXE because the Designer.cs file is not synchronized with the canvas. Question: How can I force Visual Studio to rewrite the Designer.cs file so that all the controls that I added are accounted for? I'd rather not remove the form from the project and add it back because I'd lose all the work I did to place the controls. Any assistance is greatly appreciated! SOLUTION: I was able to fix it by removing the project from the solution and then adding it back.
The difficult we do right away... ...the impossible takes slightly longer.
Yip, removing the project (or whatever it's called :laugh: ) from the solution and then adding it back will do the trick. I just had to throw this in here lol.