Repository navigation
Description
.NET version
Dotnet Info:
.NET SDK:
Version: 9.0.100-rc.2.24470.13
Commit: 3229e54b07
Workload version: 9.0.100-manifests.8fbc914b
MSBuild version: 17.12.0-preview-24469-05+fea15fbd1
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\9.0.100-rc.2.24470.13\
Host:
Version: 9.0.0-rc.2.24463.7
Architecture: x64
Commit: static
.NET SDKs installed:
9.0.100-rc.2.24470.13 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.0-rc.2.24466.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.0-rc.2.24463.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 9.0.0-rc.2.24464.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Did it work in .NET Framework?
Not tested/verified
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Yes
Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.300(default target net8.0): Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-rc.2.24470.13(default target net8.0): Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-rc.2.24470.13(retarget net9.0): Fail
4). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-rc.1.24452.12(retarget net9.0): Fail
5). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.100-preview.7.24407.12(retarget net9.0): Pass
Issue description
When retarget the 3rd party application to net9.0 and build with the latest .NET 9 sdk, it failed with error: Property 'CellTemplate' does not configure the code serialization for its property content.
Application Name: WinformsSamples, mRemoteNG, Character-Builder-5, AutoVersionsDB,HeroesPowerPlant
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100-rc.2.24470.13
App & Source checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2260303
Github Link: GitHub - dotnet/samples: Sample code referenced by the .NET documentation
Steps to reproduce
App Repro Steps:(dotnet-sdk-9.0.100-rc.2.24470.13 installed)
1.Retarget app to net9.0 in \WinformsAPP\datagridview\CSWinFormDataGridView\CSWinFormDataGridView.csproj
net9.0-windows
2. Run command "dotnet build" in \WinformsAPP\datagridview\CSWinFormDataGridView.
Expected Result:
Build successfully.
Actual Result:
Build failed with error: WFO1000: Property 'CellTemplate' does not configure the code serialization for its property content.
Minimal Repro Steps (Demo attached:WinformsDemo.zip):
- Create a default8.0 winforms project.
- Create Class1.cs.
internal class Class1 : DataGridViewColumn
{
private string test;
public string Test
{
get
{
return this.test;
}
set
{
}
}
}
- Retarget to net9.0.
- Build with dotnet-sdk-9.0.100-rc.2.24470.13.
Expected Result:
Build successfully.
Actual Result:
Build failed with error: Property 'Test' does not configure the code serialization for its property content.
Findings:
There is a similar issue filed on github: DesignerSerializationVisibility - Behaviour Changes · Issue #41964 · dotnet/docs (github.com)
This issue starts from .NET 9 RC1 release and if we use the workaround mentioned in above issue to add DesignerSerializationVisibility to property, error will go.
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@dotnet-actwx-bot @dotnet/compat
Activity
Junjun-zhao commentedon Sep 25, 2024
@merriemcgaw Could you please take a look at this issue? There are 5 apps affected in our lab.
CC: @richaverma1 @PriyaPurkayastha @marklio for awareness.
PriyaPurkayastha commentedon Sep 25, 2024
Adding @KlausLoeffelmann per chat with @merriemcgaw. Also cc @gewarren since customer created an issue for missing doc linked above. @KlausLoeffelmann is this an intentional breaking change (the analyzer work done as part of binary formatter removal) that hasn't been documented? Can you please create a breaking change issue for this using the template https://github.com/dotnet/docs/issues/new?assignees=gewarren&labels=breaking-change%2CPri1%2Cdoc-idea&projects=&template=02-breaking-change.yml&title=%5BBreaking+change%5D%3A+
PriyaPurkayastha commentedon Sep 25, 2024
Also adding @JeremyKuhne as requested by @merriemcgaw
KlausLoeffelmann commentedon Sep 25, 2024
This is by design, introduced with .NET 9 (RC1).
We need to make sure for security reasons, that properties for WinForms Designer are not serialized by accident.
We will follow up with a respective Blog Post shortly.
In the meanwhile, please fix the CodeDOM Serialization configuration for properties according to WinForms best practices:
DesignerSerializationVisibilityAttributeORDefaultValueAttributeORprivate bool ShouldSerialize[Property]method, which controls the serialization at Design Time.PriyaPurkayastha commentedon Sep 25, 2024
@KlausLoeffelmann thanks for confirming. However, our breaking change process for .NET is that whenever we introduce a breaking change, it has to be accompanied by a breaking change doc in the very same release so that customers that start using the new release are not taken by surprise (like we saw with this change where two customers as well as .NET AppCompat lab did not know to expect this). Request you to kindly create the breaking change doc issue using the template provided above immediately. The blog post will definitely help everyone but does not substitute the breaking change documentation.
KlausLoeffelmann commentedon Sep 26, 2024
OK, yes, that makes sense!
I created this and will make sure the blog post will be out ASAP!
(It's almost done, so, no problem).
dotnet/docs#42724
@JeremyKuhne, @merriemcgaw.
kirsan31 commentedon Sep 26, 2024
@KlausLoeffelmann
I think it would be helpful to point out default behaviour:
Junjun-zhao commentedon Oct 8, 2024
@KlausLoeffelmann Thank you for creating the breaking change doc quickly. Could you please close this issue? Thanks.