Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 649319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:55:53+00:00 2026-05-13T21:55:53+00:00

Several times throughout the course of our current project, the visual studio designer has

  • 0

Several times throughout the course of our current project, the visual studio designer has made modifications that resulted in losing code. For example, event handlers wirings that were set up manually in the designer code were lost. Does anyone know why this happens?

Edit: I understand that editing these files manually is not a good idea, but it has also happened with other event wirings set up through the designer.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:55:53+00:00Added an answer on May 13, 2026 at 9:55 pm

    Well for starters read the XML at the top of your designer.cs file.

    /// <summary>
    /// Required method for Designer support - do not modify
    /// contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    

    Generally you shouldn’t be modifying these files as they are auto-generated. It’s probably the reason why there is a slight attempt to hide the code within a branch, underneath the main partial class.

    I have on occasion found that the process has removed its own auto-generated code that I’ve had to merge back in. Most commonly it decides it’s not going to instantiate custom user controls anymore, so when I start running I get a NullReferenceException.

    Really the answer is to put the code somewhere else, like in the constructor before calling the InitializeComponent() method. If fellow developers aren’t aware of this, then you should inform them and educate them, the fact that the files are .designer.cs should raise questions even to newer developers as to why the strange extension.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing Django project that has several models using concrete inheritance of
Several times I heard that PHP hosting is much cheaper than ASP.NET one. I
In a database I use throughout several projects, there is a field that should
Several times I've read that unpack() is faster than substr() , especially as the
I have a live Lucene index that is updated throughout the day. When several
I'm writing a CPU intensive program in C++ that has several threads needing to
I googled several times but couldn't find what I was looking for. Android assigns
My app crashes several times without any error or stack trace on my console.
I've tried several times to get grep or sed to do what I want
I've run into this problems several times before when trying to do some html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.