Compiler Warning About PaperKind in Linux and Mac
|Product||Progress® Telerik® Reporting|
I am getting a warning in the compiler when assigning the following:
report.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A4;
report variable is of the type Telerik.Reporting.Report.
The warning appears when compiling on MacOS or Linux but not on Windows.
PageSettings properties values are from the System.Drawing.Printing namespace that is supported only on Windows starting with .NET 6.
The enumerations from the namespace, including enum PaperKind may be considered as cross-platform although they are part of the
System.Drawing as they will not throw a PlatformNotSupportedException since they don't contain any code
The reason for the warning is that the entire assembly is attributed with
[assembly: SupportedOSPlatform("windows")] - see SupportedOSPlatformAttribute.
The warning cannot be avoided unless Microsoft decides to remove the attribute on the assembly level and add it only to the functionality that is actually not supported.