Description
Our security scans are reporting that the generated class implements ISerializable (via RegEx subclass) but fails to add the [Serializable] attribute.
Reproduction Steps
Implement the GeneratedRegEx attribute like the following:
[GeneratedRegex(@"^\d+(?:,\d+)*$", RegexOptions.IgnoreCase, "en-US")]
public static partial Regex CommaSeperatedNumericList();
Note generated class lacks the [Serializable] attribute.
[GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "8.0.9.8001")]
file sealed class CommaSeperatedNumericList_0 : Regex
Expected behavior
The generated class should have the [Serializable] attribute.
Actual behavior
The generated class lacks the [Serializable] attribute.
Regression?
Unknown. First time implementing in .Net 8
Known Workarounds
No response
Configuration
- net8.0
- Windows 11 and Windows Server 16
- x64
- Unknown
- Not using Blazor
Other information
No response
Description
Our security scans are reporting that the generated class implements ISerializable (via RegEx subclass) but fails to add the [Serializable] attribute.
Reproduction Steps
Implement the GeneratedRegEx attribute like the following:
Note generated class lacks the [Serializable] attribute.
Expected behavior
The generated class should have the [Serializable] attribute.
Actual behavior
The generated class lacks the [Serializable] attribute.
Regression?
Unknown. First time implementing in .Net 8
Known Workarounds
No response
Configuration
Other information
No response