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

  • Home
  • SEARCH
  • 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 99475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:23:41+00:00 2026-05-11T00:23:41+00:00

I am currently building a .Net userform using C# and I am populating it

  • 0

I am currently building a .Net userform using C# and I am populating it with custom user controls. The controls each have an accessor that gets and sets the object that contains the data that the control will be populated with.

At runtime, everything works great, but at design time I will get errors in the form designer. The errors are always along the lines of ‘Cannot convert an object of type [ObjectA] to an object of type [ObjectA]’

At this point, I can go into the resx file and delete the row that references the object of type ObjectA and then go into the designer.cs file and delete the line in InitializeComponent that sets the accessor of the control to the data from the resx file.

Once I’ve done that, the form will display in the designer until it rebuilds the InitializeComponet and reinserts the lines / data into the resx and InitializeComponent.

What am I missing in my control and class design that will end this cycle? I’ve tried using the Liscence Usage mode and the Designer runtime mode with mixed results and I would prefer it if I could solve this in my design.

Thanks for any help that you can provide.

Update: I added the attribute…

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] 

To the property and I got an error in the designer ‘ObjectA is null, this is not allowed!’, so I changed the line to …

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] 

and the issue went away. Since I don’t need to set any of these properties at design time, the hidden attribute is probably more appropriate.

Thanks.

  • 1 1 Answer
  • 0 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. 2026-05-11T00:23:41+00:00Added an answer on May 11, 2026 at 12:23 am

    It sounds like it could be the way that the object is being serialized.

    The designer is doing a binary serialization of the object into the resx file, what you probably need is code to be produced in you .Designer.cs file.

    Try putting the following attribute line on the property: [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]

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

Sidebar

Ask A Question

Stats

  • Questions 112k
  • Answers 112k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One approach is to have one "layer" (well, not really… May 11, 2026 at 9:51 pm
  • Editorial Team
    Editorial Team added an answer Instead of hiding it remove the element from the DOM… May 11, 2026 at 9:51 pm
  • Editorial Team
    Editorial Team added an answer You try resizing the text using percentage. $('#parent').css('font-size', '200%')// This… May 11, 2026 at 9:51 pm

Related Questions

I am currently building a Windows Service with C# and I just can't figure
I am currently building in Version 3.5 of the .Net framework and I have
I am currently building an application using ASP.NET MVC. The data entry pages are
I am building a web based application written in ASP.NET and Flex. One of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.