Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Code-Behind in Designer.cs File [SOLVED]

Code-Behind in Designer.cs File [SOLVED]

Scheduled Pinned Locked Moved Windows Forms
questioncsharpdotnetasp-netvisual-studio
2 Posts 2 Posters 14 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Richard Andrew x64R Offline
    Richard Andrew x64R Offline
    Richard Andrew x64
    wrote on last edited by
    #1

    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.

    A 1 Reply Last reply
    0
    • Richard Andrew x64R Richard Andrew x64

      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.

      A Offline
      A Offline
      Andre Oosthuizen
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups