dotnet / dotnet/samples

[dotnet-sdk-9.0.100-rc.2.24470.13] The windowsforms/datagridview demo App build with error: Property 'XXX' does not configure the code serialization for its property content

Open
#6,992 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
5.1k
Avg merge
9h 11m
Merged PRs (30d)
1

Description

We are doing Application compatibility testing with this application against the latest .NET 9 SDK. When retarget the application to net9.0 and build with the latest .NET 9 SDK, it failed with error: P`roperty 'xxx' does not configure the code serialization for its property content`

After the investigation, it is related to a .NET 9 breaking change https://github.com/dotnet/docs/issues/42724

**You can fix the CodeDOM Serialization configuration for properties if you want**

- Attribute with the DesignerSerializationVisibilityAttribute OR
- Attribute with the DefaultValueAttribute OR
- Amend a private bool ShouldSerialize[Property] method, which controls the serialization at Design Time.

**Steps to Reproduce (for bugs)**

1. Cd to WinformsSamples\datagridview\CSWinFormDataGridView
2. Change TargetFramework to net9.0-windows in the CSWinFormDataGridView.csproj.
3. dotnet build with 9.0.100-rc.2.24470.13.

**Expected Result:**
build successfully without error
**Actual Result:**
build failed with `Property 'xxx' does not configure the code serialization for its property content`

Please refer to more information from https://github.com/dotnet/winforms/issues/12220

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.