Skip to content

Commit 081fdb5

Browse files
committed
Depend on Microsoft.CodeAnalysis 4.13.0
Closes #34637
1 parent ce99d82 commit 081fdb5

10 files changed

+24
-30
lines changed

Diff for: Directory.Packages.props

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
<!-- build dependencies-->
3434
<PackageVersion Include="Microsoft.Build.Locator" Version="1.7.8" />
35+
<PackageVersion Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
3536
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCoreVersion)" />
3637
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Templating" Version="$(MicrosoftDotNetBuildTasksTemplatingVersion)" />
3738

@@ -56,8 +57,6 @@
5657
<PackageVersion Include="SQLitePCLRaw.bundle_e_sqlite3" Version="$(SQLitePCLRawVersion)" />
5758

5859
<!-- Pinned versions for Component Governance/NuGetAudit - Remove when root dependencies are updated -->
59-
<!--Workaround for Microsoft.CodeAnalysis.Workspaces.MSBuild 4.8.0, see https://github.com/dotnet/efcore/issues/34637-->
60-
<PackageVersion Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
6160
<!--Workaround for Microsoft.Data.SqlClient v5.1.6 and Microsoft.CodeAnalysis.Analyzer.Testing v1.1.2-->
6261
<PackageVersion Include="System.Formats.Asn1" Version="$(SystemFormatsAsn1Version)" />
6362
<PackageVersion Include="System.Runtime.Caching" Version="$(SystemRuntimeCachingVersion)" />

Diff for: EFCore.sln

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1414
global.json = global.json
1515
tools\Resources.tt = tools\Resources.tt
1616
eng\Versions.props = eng\Versions.props
17+
NuGet.config = NuGet.config
1718
EndProjectSection
1819
EndProject
1920
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC}"

Diff for: eng/Versions.props

+4-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@
3636
<MicrosoftDotNetBuildTasksTemplatingVersion>10.0.0-beta.25126.4</MicrosoftDotNetBuildTasksTemplatingVersion>
3737
</PropertyGroup>
3838
<PropertyGroup Label="Other dependencies">
39-
<MicrosoftBuildFrameworkVersion>17.8.3</MicrosoftBuildFrameworkVersion>
40-
<MicrosoftBuildUtilitiesCoreVersion>17.8.3</MicrosoftBuildUtilitiesCoreVersion>
41-
<!-- NB: This version affects Visual Studio compatibility. See https://learn.microsoft.com/visualstudio/extensibility/roslyn-version-support and https://github.com/dotnet/efcore/issues/34637 -->
42-
<MicrosoftCodeAnalysisVersion>4.8.0</MicrosoftCodeAnalysisVersion>
43-
<MicrosoftCodeAnalysisTestingVersion>1.1.2</MicrosoftCodeAnalysisTestingVersion>
39+
<MicrosoftBuildFrameworkVersion>17.13.9</MicrosoftBuildFrameworkVersion>
40+
<MicrosoftBuildUtilitiesCoreVersion>17.13.9</MicrosoftBuildUtilitiesCoreVersion>
41+
<!-- NB: This version affects Visual Studio compatibility. See https://github.com/dotnet/roslyn/blob/main/docs/wiki/NuGet-packages.md and https://learn.microsoft.com/visualstudio/extensibility/roslyn-version-support -->
42+
<MicrosoftCodeAnalysisVersion>4.13.0</MicrosoftCodeAnalysisVersion>
4443
<AzureIdentityVersion>1.13.1</AzureIdentityVersion>
4544
<AzureResourceManagerCosmosDBVersion>1.3.2</AzureResourceManagerCosmosDBVersion>
4645
<OpenTelemetryExporterInMemoryVersion>1.8.1</OpenTelemetryExporterInMemoryVersion>

Diff for: src/EFCore.Analyzers/EFCore.Analyzers.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<ImplicitUsings>true</ImplicitUsings>
1212
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
1313
<NoWarn>$(NoWarn);NU5128</NoWarn>
14+
<NoWarn>$(NoWarn);RS1038</NoWarn> <!-- Compiler extensions should be implemented in assemblies with compiler-provided references, #35752 -->
1415
</PropertyGroup>
1516

1617
<ItemGroup>

Diff for: src/EFCore.Analyzers/InternalUsageDiagnosticAnalyzer.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ private static readonly DiagnosticDescriptor Descriptor
2323
defaultSeverity: DiagnosticSeverity.Warning,
2424
isEnabledByDefault: true);
2525

26-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
27-
=> ImmutableArray.Create(Descriptor);
26+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => [Descriptor];
2827

2928
public override void Initialize(AnalysisContext context)
3029
{

Diff for: src/EFCore.Analyzers/InterpolatedStringUsageInRawQueriesCodeFixProvider.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ namespace Microsoft.EntityFrameworkCore;
1515
[Shared]
1616
public sealed class InterpolatedStringUsageInRawQueriesCodeFixProvider : CodeFixProvider
1717
{
18-
public override ImmutableArray<string> FixableDiagnosticIds
19-
=> ImmutableArray.Create(EFDiagnostics.InterpolatedStringUsageInRawQueries);
18+
public override ImmutableArray<string> FixableDiagnosticIds => [EFDiagnostics.InterpolatedStringUsageInRawQueries];
2019

2120
public override FixAllProvider GetFixAllProvider()
2221
=> WellKnownFixAllProviders.BatchFixer;

Diff for: src/EFCore.Analyzers/InterpolatedStringUsageInRawQueriesDiagnosticAnalyzer.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ private static readonly DiagnosticDescriptor Descriptor
2121
defaultSeverity: DiagnosticSeverity.Warning,
2222
isEnabledByDefault: true);
2323

24-
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
25-
=> ImmutableArray.Create(Descriptor);
24+
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => [Descriptor];
2625

2726
public override void Initialize(AnalysisContext context)
2827
{

Diff for: src/EFCore.Analyzers/UninitializedDbSetDiagnosticSuppressor.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ public sealed class UninitializedDbSetDiagnosticSuppressor : DiagnosticSuppresso
1717
justification: AnalyzerStrings.UninitializedDbSetWarningSuppressionJustification);
1818

1919
/// <inheritdoc />
20-
public override ImmutableArray<SuppressionDescriptor> SupportedSuppressions { get; }
21-
= ImmutableArray.Create(SuppressUninitializedDbSetRule);
20+
public override ImmutableArray<SuppressionDescriptor> SupportedSuppressions { get; } = [SuppressUninitializedDbSetRule];
2221

2322
/// <inheritdoc />
2423
public override void ReportSuppressions(SuppressionAnalysisContext context)
@@ -28,7 +27,7 @@ public override void ReportSuppressions(SuppressionAnalysisContext context)
2827

2928
foreach (var diagnostic in context.ReportedDiagnostics)
3029
{
31-
// We have an warning about an uninitialized non-nullable property.
30+
// We have a warning about an uninitialized non-nullable property.
3231

3332
// CS8618 contains the location of the uninitialized property in AdditionalLocations; note that if the class has a constructor,
3433
// the diagnostic main Location points to the constructor rather than to the uninitialized property.

Diff for: test/Directory.Packages.props

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
<Project>
22
<Import Project="..\Directory.Packages.props" />
3+
4+
<!-- Dependencies used only in tests -->
35
<ItemGroup>
4-
<!-- testing dependencies -->
5-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
6-
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
6+
<!-- See https://github.com/dotnet/roslyn-sdk/issues/1175 -->
7+
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzer.Testing" Version="1.1.3-beta1.24423.1" />
8+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="1.1.3-beta1.24352.1" />
9+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="1.1.3-beta1.24352.1" />
710

8-
<!-- dependencies only used in tests -->
911
<PackageVersion Include="Azure.Identity" Version="$(AzureIdentityVersion)" />
1012
<PackageVersion Include="Azure.ResourceManager.CosmosDB" Version="$(AzureResourceManagerCosmosDBVersion)" />
1113
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0" />
@@ -21,12 +23,6 @@
2123
<PackageVersion Include="SQLitePCLRaw.bundle_e_sqlite3mc" Version="$(SQLitePCLRawVersion)" />
2224
<PackageVersion Include="SQLitePCLRaw.bundle_winsqlite3" Version="$(SQLitePCLRawVersion)" />
2325

24-
<!-- Newer version of Roslyn used in tests for testing -->
25-
<!--https://github.com/dotnet/efcore/issues/34637-->
26-
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
27-
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.10.0" />
28-
<PackageVersion Update="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.10.0" />
29-
3026
<!-- Pinned versions for Component Governance/NuGetAudit - Remove when root dependencies are updated -->
3127
<!--Workaround for IdentityServer4.EntityFramework v4.1.2-->
3228
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.8" />

Diff for: test/EFCore.Analyzers.Tests/EFCore.Analyzers.Tests.csproj

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
77
<PreserveCompilationContext>true</PreserveCompilationContext>
88
<ImplicitUsings>true</ImplicitUsings>
9+
<!-- For the following see https://github.com/dotnet/roslyn-sdk/issues/1175#issuecomment-2708495457 -->
10+
<NoWarn>$(NoWarn);NU1608</NoWarn>
911
</PropertyGroup>
1012

1113
<ItemGroup>
@@ -45,10 +47,10 @@
4547
<PackageReference Include="Microsoft.Extensions.DependencyModel" />
4648
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" />
4749
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" />
48-
<!-- Workaround for https://github.com/dotnet/roslyn-sdk/issues/1175 -->
49-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" VersionOverride="$(MicrosoftCodeAnalysisVersion)" />
50-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" VersionOverride="$(MicrosoftCodeAnalysisVersion)" />
51-
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" VersionOverride="$(MicrosoftCodeAnalysisVersion)" />
50+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzer.Testing" />
51+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
52+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
53+
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" />
5254
</ItemGroup>
5355

5456
<ItemGroup>

0 commit comments

Comments
 (0)