Skip to content

Commit 4e6167a

Browse files
committed
Add workaround for RequiresPreviewFeatures and regenerate SLE compat suppressions.
1 parent 3d0d643 commit 4e6167a

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

Directory.Build.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
<PackageDescription Condition="'$(PackageDescription)' == '' and '$(UseRuntimePackageDisclaimer)' == 'true'">$(RuntimePackageDisclaimer)</PackageDescription>
7979
<!-- Keep in sync as required by the Packaging SDK in Arcade. -->
8080
<Description>$(PackageDescription)</Description>
81+
<!-- Until we update the TFM to match the Major version, we need to patch in support for RequiresPreviewFeatures -->
82+
<GenerateRequiresPreviewFeaturesAttribute Condition="'$(TargetFrameworkMoniker)' == '$(NetCoreAppCurrentTargetFrameworkMoniker)'">true</GenerateRequiresPreviewFeaturesAttribute>
8183
</PropertyGroup>
8284

8385
<Target Name="ValidateTargetOSLowercase"
@@ -121,7 +123,7 @@
121123
AfterTargets="ResolveProjectReferences"
122124
BeforeTargets="FindReferenceAssembliesForReferences"
123125
Condition="'@(ProjectReference)' != '' and '@(_ResolvedProjectReferencePaths)' != ''">
124-
<!-- If we have a ProjectReference to CoreLib, we need to compile against implementation assemblies,
126+
<!-- If we have a ProjectReference to CoreLib, we need to compile against implementation assemblies,
125127
and ignore architecture mismatches in those implementation assemblies. -->
126128
<PropertyGroup Condition="@(_ResolvedProjectReferencePaths->AnyHaveMetadataValue('MSBuildSourceProjectFile', '$(CoreLibProject)'))">
127129
<CompileUsingReferenceAssemblies Condition="'$(CompileUsingReferenceAssemblies)' == ''">false</CompileUsingReferenceAssemblies>

src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,48 @@
9797
<Left>ref/net8.0/System.Linq.Expressions.dll</Left>
9898
<Right>lib/net8.0/System.Linq.Expressions.dll</Right>
9999
</Suppression>
100+
<Suppression>
101+
<DiagnosticId>CP0016</DiagnosticId>
102+
<Target>M:System.Linq.Expressions.Expression.Call(System.Linq.Expressions.Expression,System.String,System.Type[],System.Linq.Expressions.Expression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
103+
<Left>ref/net8.0/System.Linq.Expressions.dll</Left>
104+
<Right>lib/net8.0/System.Linq.Expressions.dll</Right>
105+
</Suppression>
106+
<Suppression>
107+
<DiagnosticId>CP0016</DiagnosticId>
108+
<Target>M:System.Linq.Expressions.Expression.Call(System.Type,System.String,System.Type[],System.Linq.Expressions.Expression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
109+
<Left>ref/net8.0/System.Linq.Expressions.dll</Left>
110+
<Right>lib/net8.0/System.Linq.Expressions.dll</Right>
111+
</Suppression>
112+
<Suppression>
113+
<DiagnosticId>CP0016</DiagnosticId>
114+
<Target>M:System.Linq.Expressions.Expression.ListInit(System.Linq.Expressions.NewExpression,System.Collections.Generic.IEnumerable{System.Linq.Expressions.Expression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
115+
<Left>ref/net8.0/System.Linq.Expressions.dll</Left>
116+
<Right>lib/net8.0/System.Linq.Expressions.dll</Right>
117+
</Suppression>
118+
<Suppression>
119+
<DiagnosticId>CP0016</DiagnosticId>
120+
<Target>M:System.Linq.Expressions.Expression.ListInit(System.Linq.Expressions.NewExpression,System.Linq.Expressions.Expression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
121+
<Left>ref/net8.0/System.Linq.Expressions.dll</Left>
122+
<Right>lib/net8.0/System.Linq.Expressions.dll</Right>
123+
</Suppression>
124+
<Suppression>
125+
<DiagnosticId>CP0016</DiagnosticId>
126+
<Target>M:System.Linq.Expressions.Expression.ListInit(System.Linq.Expressions.NewExpression,System.Reflection.MethodInfo,System.Collections.Generic.IEnumerable{System.Linq.Expressions.Expression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
127+
<Left>ref/net8.0/System.Linq.Expressions.dll</Left>
128+
<Right>lib/net8.0/System.Linq.Expressions.dll</Right>
129+
</Suppression>
130+
<Suppression>
131+
<DiagnosticId>CP0016</DiagnosticId>
132+
<Target>M:System.Linq.Expressions.Expression.ListInit(System.Linq.Expressions.NewExpression,System.Reflection.MethodInfo,System.Linq.Expressions.Expression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
133+
<Left>ref/net8.0/System.Linq.Expressions.dll</Left>
134+
<Right>lib/net8.0/System.Linq.Expressions.dll</Right>
135+
</Suppression>
136+
<Suppression>
137+
<DiagnosticId>CP0016</DiagnosticId>
138+
<Target>M:System.Runtime.CompilerServices.CallSite`1.Create(System.Runtime.CompilerServices.CallSiteBinder):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
139+
<Left>ref/net8.0/System.Linq.Expressions.dll</Left>
140+
<Right>lib/net8.0/System.Linq.Expressions.dll</Right>
141+
</Suppression>
100142
<Suppression>
101143
<DiagnosticId>CP0016</DiagnosticId>
102144
<Target>M:System.Linq.Expressions.Expression.Call(System.Linq.Expressions.Expression,System.String,System.Type[],System.Linq.Expressions.Expression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute]</Target>
@@ -145,4 +187,4 @@
145187
<Left>ref/net8.0/System.Linq.Expressions.dll</Left>
146188
<Right>lib/net8.0/System.Linq.Expressions.dll</Right>
147189
</Suppression>
148-
</Suppressions>
190+
</Suppressions>

0 commit comments

Comments
 (0)