未验证 提交 ba97cf80 编写于 作者: J Jeremy Koritzinsky 提交者: GitHub

Use the BannedApiAnalyzer instead of the LinqPoison mechanism to ban Linq in...

Use the BannedApiAnalyzer instead of the LinqPoison mechanism to ban Linq in the managed type system (#86673)
上级 2ec9a0ca
......@@ -70,7 +70,7 @@
-->
<MicrosoftCodeAnalysisVersion_LatestVS>4.5.0</MicrosoftCodeAnalysisVersion_LatestVS>
<!-- Some of the analyzer dependencies used by ILLink project -->
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>3.3.2</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>3.3.5-beta1.23270.2</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
</PropertyGroup>
<!--
These packages affect the design-time experience in VS, so we update them at the same cadance as the MicrosoftCodeAnalysisVersion_LatestVS version.
......
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System
{
//
// The type system needs to be low level enough to be usable as
// an actual runtime type system.
//
// LINQ is not low level enough to be allowable in the type system.
//
// It also has performance characteristics that make it a poor choice
// in high performance components such as the type system.
//
// If you get an error pointing to here, the fix is to remove
// "using System.Linq" from your file. Do not modify this file or
// remove it from the project.
//
internal sealed class Linq { }
}
N:System.Linq;The type system needs to be low level enough to be usable as an actual runtime type system. LINQ is not low level enough to be allowable in the type system.
......@@ -27,7 +27,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Condition = "'$(EnableDiaSymReaderUse)' == 'true'" Include="Microsoft.DiaSymReader">
<PackageReference Condition="'$(EnableDiaSymReaderUse)' == 'true'" Include="Microsoft.DiaSymReader">
<Version>1.4.0</Version>
</PackageReference>
</ItemGroup>
......@@ -252,9 +252,6 @@
<Compile Include="..\..\Common\TypeSystem\Common\LayoutInt.cs">
<Link>TypeSystem\Common\LayoutInt.cs</Link>
</Compile>
<Compile Include="..\..\Common\TypeSystem\Common\LinqPoison.cs">
<Link>TypeSystem\Common\LinqPoison.cs</Link>
</Compile>
<Compile Include="..\..\Common\TypeSystem\Common\MetadataType.cs">
<Link>TypeSystem\Common\MetadataType.cs</Link>
</Compile>
......@@ -667,4 +664,15 @@
<Link>TypeSystem\Sorting\TypeSystemComparer.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="BannedSymbols.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="$(MicrosoftCodeAnalysisBannedApiAnalyzersVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册