Skip to content

Depend on Microsoft.CodeAnalysis 4.13.0 #35753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

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

Expand All @@ -54,12 +55,5 @@
<PackageVersion Include="SQLitePCLRaw.core" Version="$(SQLitePCLRawVersion)" />
<PackageVersion Include="SQLitePCLRaw.bundle_sqlite3" Version="$(SQLitePCLRawVersion)" />
<PackageVersion Include="SQLitePCLRaw.bundle_e_sqlite3" Version="$(SQLitePCLRawVersion)" />

<!-- Pinned versions for Component Governance/NuGetAudit - Remove when root dependencies are updated -->
<!--Workaround for Microsoft.CodeAnalysis.Workspaces.MSBuild 4.8.0, see https://github.com/dotnet/efcore/issues/34637-->
<PackageVersion Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
<!--Workaround for Microsoft.Data.SqlClient v5.1.6 and Microsoft.CodeAnalysis.Analyzer.Testing v1.1.2-->
<PackageVersion Include="System.Formats.Asn1" Version="$(SystemFormatsAsn1Version)" />
<PackageVersion Include="System.Runtime.Caching" Version="$(SystemRuntimeCachingVersion)" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions EFCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
tools\Resources.tt = tools\Resources.tt
eng\Versions.props = eng\Versions.props
NuGet.config = NuGet.config
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC}"
Expand Down
11 changes: 6 additions & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@
<MicrosoftDotNetBuildTasksTemplatingVersion>10.0.0-beta.25126.4</MicrosoftDotNetBuildTasksTemplatingVersion>
</PropertyGroup>
<PropertyGroup Label="Other dependencies">
<MicrosoftBuildFrameworkVersion>17.8.3</MicrosoftBuildFrameworkVersion>
<MicrosoftBuildUtilitiesCoreVersion>17.8.3</MicrosoftBuildUtilitiesCoreVersion>
<!-- 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 -->
<MicrosoftCodeAnalysisVersion>4.8.0</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisTestingVersion>1.1.2</MicrosoftCodeAnalysisTestingVersion>
<MicrosoftBuildFrameworkVersion>17.13.9</MicrosoftBuildFrameworkVersion>
<MicrosoftBuildUtilitiesCoreVersion>17.13.9</MicrosoftBuildUtilitiesCoreVersion>
<!-- 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 -->
<MicrosoftCodeAnalysisVersion>4.13.0</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisAnalyzerTestingVersion>1.1.3-beta1.24423.1</MicrosoftCodeAnalysisAnalyzerTestingVersion>
<MicrosoftCodeAnalysisCSharpTestingVersion>1.1.3-beta1.24352.1</MicrosoftCodeAnalysisCSharpTestingVersion>
<AzureIdentityVersion>1.13.1</AzureIdentityVersion>
<AzureResourceManagerCosmosDBVersion>1.3.2</AzureResourceManagerCosmosDBVersion>
<OpenTelemetryExporterInMemoryVersion>1.8.1</OpenTelemetryExporterInMemoryVersion>
Expand Down
1 change: 1 addition & 0 deletions src/EFCore.Analyzers/EFCore.Analyzers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<ImplicitUsings>true</ImplicitUsings>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<NoWarn>$(NoWarn);RS1038</NoWarn> <!-- Compiler extensions should be implemented in assemblies with compiler-provided references, #35752 -->
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/EFCore.Analyzers/InternalUsageDiagnosticAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ private static readonly DiagnosticDescriptor Descriptor
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true);

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
=> ImmutableArray.Create(Descriptor);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => [Descriptor];

public override void Initialize(AnalysisContext context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ namespace Microsoft.EntityFrameworkCore;
[Shared]
public sealed class InterpolatedStringUsageInRawQueriesCodeFixProvider : CodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds
=> ImmutableArray.Create(EFDiagnostics.InterpolatedStringUsageInRawQueries);
public override ImmutableArray<string> FixableDiagnosticIds => [EFDiagnostics.InterpolatedStringUsageInRawQueries];

public override FixAllProvider GetFixAllProvider()
=> WellKnownFixAllProviders.BatchFixer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ private static readonly DiagnosticDescriptor Descriptor
defaultSeverity: DiagnosticSeverity.Warning,
isEnabledByDefault: true);

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
=> ImmutableArray.Create(Descriptor);
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => [Descriptor];

public override void Initialize(AnalysisContext context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ public sealed class UninitializedDbSetDiagnosticSuppressor : DiagnosticSuppresso
justification: AnalyzerStrings.UninitializedDbSetWarningSuppressionJustification);

/// <inheritdoc />
public override ImmutableArray<SuppressionDescriptor> SupportedSuppressions { get; }
= ImmutableArray.Create(SuppressUninitializedDbSetRule);
public override ImmutableArray<SuppressionDescriptor> SupportedSuppressions { get; } = [SuppressUninitializedDbSetRule];

/// <inheritdoc />
public override void ReportSuppressions(SuppressionAnalysisContext context)
Expand All @@ -28,7 +27,7 @@ public override void ReportSuppressions(SuppressionAnalysisContext context)

foreach (var diagnostic in context.ReportedDiagnostics)
{
// We have an warning about an uninitialized non-nullable property.
// We have a warning about an uninitialized non-nullable property.

// CS8618 contains the location of the uninitialized property in AdditionalLocations; note that if the class has a constructor,
// the diagnostic main Location points to the constructor rather than to the uninitialized property.
Expand Down
1 change: 0 additions & 1 deletion src/EFCore.Tasks/EFCore.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net472'">
<PackageReference Include="Microsoft.Build.Framework" PrivateAssets="all" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.Build.Utilities.Core" PrivateAssets="all" ExcludeAssets="Runtime" />
</ItemGroup>

Expand Down
16 changes: 6 additions & 10 deletions test/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<Project>
<Import Project="..\Directory.Packages.props" />

<!-- Dependencies used only in tests -->
<ItemGroup>
<!-- testing dependencies -->
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="$(MicrosoftCodeAnalysisTestingVersion)" />
<!-- See https://github.com/dotnet/roslyn-sdk/issues/1175 -->
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzer.Testing" Version="$(MicrosoftCodeAnalysisAnalyzerTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" Version="$(MicrosoftCodeAnalysisCSharpTestingVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" Version="$(MicrosoftCodeAnalysisCSharpTestingVersion)" />

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

<!-- Newer version of Roslyn used in tests for testing -->
<!--https://github.com/dotnet/efcore/issues/34637-->
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.10.0" />
<PackageVersion Update="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.10.0" />

<!-- Pinned versions for Component Governance/NuGetAudit - Remove when root dependencies are updated -->
<!--Workaround for IdentityServer4.EntityFramework v4.1.2-->
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.8" />
Expand Down
10 changes: 6 additions & 4 deletions test/EFCore.Analyzers.Tests/EFCore.Analyzers.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
<PreserveCompilationContext>true</PreserveCompilationContext>
<ImplicitUsings>true</ImplicitUsings>
<!-- For the following see https://github.com/dotnet/roslyn-sdk/issues/1175#issuecomment-2708495457 -->
<NoWarn>$(NoWarn);NU1608</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -45,10 +47,10 @@
<PackageReference Include="Microsoft.Extensions.DependencyModel" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing.XUnit" />
<!-- Workaround for https://github.com/dotnet/roslyn-sdk/issues/1175 -->
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" VersionOverride="$(MicrosoftCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" VersionOverride="$(MicrosoftCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" VersionOverride="$(MicrosoftCodeAnalysisVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzer.Testing" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public async Task FullSourceTest(
// This turns on the interceptors feature for the designated namespace(s).
var parseOptions = new CSharpParseOptions().WithFeatures(
[
new KeyValuePair<string, string>("InterceptorsPreviewNamespaces", "Microsoft.EntityFrameworkCore.GeneratedInterceptors")
new KeyValuePair<string, string>("InterceptorsNamespaces", "Microsoft.EntityFrameworkCore.GeneratedInterceptors")
]);

var syntaxTree = CSharpSyntaxTree.ParseText(source, parseOptions, path: "Test.cs");
Expand Down