Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DesignerSerializationVisibility - Behaviour Changes #41964

Closed
AngeloCresta opened this issue Jul 31, 2024 · 3 comments
Closed

DesignerSerializationVisibility - Behaviour Changes #41964

AngeloCresta opened this issue Jul 31, 2024 · 3 comments

Comments

@AngeloCresta
Copy link

AngeloCresta commented Jul 31, 2024

Type of issue

Missing information

Description

Starting from .Net 9.0 RC1 (9.0.100-rc.1.24380.1)the "missing DesignerSerializationVisibility" is treated as an error: WFO1000 for Properties where a default value is not provided.

To suppress all the WFO1000 errors in the project, add a property to your project file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
   ...
   <NoWarn>$(NoWarn);WFO1000</NoWarn>
  </PropertyGroup>
</Project>

image

Regards,
Angelo

Page URL

https://learn.microsoft.com/en-us/dotnet/core/compatibility/windows-forms/9.0/componentdesigner-initialize

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/compatibility/windows-forms/9.0/componentdesigner-initialize.md

Document Version Independent Id

f5762761-6cf1-56e1-60b5-6e641fbabe30

Article author

@gewarren

Metadata

  • ID: e5fcbbb2-0764-836f-a430-f7d81bd96554
  • Service: dotnet-fundamentals
@ramoneeza
Copy link

This is making a HUGE problem when using Forms that are called from other Forms as child ones. When using "Forms" that error should be excluded.
image

@ramoneeza
Copy link

A workarround:

[System.Diagnostics.CodeAnalysis.SuppressMessage("WinForms Security", "WFO1000", Justification = "No Error on forms")]
public partial class Form1 : Form
{
public IBankIcon? CurrentBank { get; private set; }
public Form1()

@AngeloCresta
Copy link
Author

Treated here:
#42724

I close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants