dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.21k stars 9.95k forks source link

RouteHandlerAnalyzer throwing exception. #52114

Closed grosch-intl closed 10 months ago

grosch-intl commented 10 months ago

Is there an existing issue for this?

Describe the bug

After upgrading my project to .NET 8 I'm getting tons of these two exceptions shown below when I do my dotnet build command. It compiles without errors, but I get tons of warnings.

It's not giving me any info about where it comes from other than just the csproj file so I'm not sure how to make this reproducible for you.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

CSC : warning AD0001: Analyzer 'Microsoft.AspNetCore.Analyzers.RouteEmbeddedLanguage.RoutePatternAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'Failed to resolve well-known type 'Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions'.'. [C:\Users\grosch\source\repos\newlamp\server\LaMP.API\LaMP.API.csproj]

CSC : warning AD0001: Analyzer 'Microsoft.AspNetCore.Analyzers.RouteHandlers.RouteHandlerAnalyzer' threw an exception of type 'System.InvalidOperationException' with message 'Failed to resolve well-known type 'Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions'.'. [C:\Users\grosch\source\repos\newlamp\server\LaMP.API\LaMP.API.csproj]

.NET Version

8.0.100

Anything else?

.NET SDK:
 Version:           8.0.100
 Commit:            57efcf1350
 Workload version:  8.0.100-manifests.8d38d0cc

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.100\

.NET workloads installed:
 Workload version: 8.0.100-manifests.8d38d0cc
There are no installed workloads to display.

Host:
  Version:      8.0.0
  Architecture: x64
  Commit:       5535e31a71

.NET SDKs installed:
  8.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

These are my list of references:

  <ItemGroup>
    <PackageReference Include="AsyncFixer" Version="1.6.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
    <PackageReference Include="DocumentFormat.OpenXml" Version="2.20.0" />
    <PackageReference Include="EPPlus" Version="7.0.1" />
    <PackageReference Include="HotChocolate.AspNetCore" Version="13.7.0" />
    <PackageReference Include="HotChocolate.AspNetCore.Authorization" Version="13.7.0" />
    <PackageReference Include="HotChocolate.Data.EntityFramework" Version="13.7.0" />
    <PackageReference Include="HotChocolate.PersistedQueries.FileSystem" Version="13.7.0" />
    <PackageReference Include="HotChocolate.Types.Analyzers" Version="13.7.0">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
    <PackageReference Include="Microsoft.Identity.Web" Version="2.15.3" />
    <PackageReference Include="Microsoft.Identity.Web.UI" Version="2.15.3" />
    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
    <PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.8.14">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="RegisteredInterfaceGenerator" Version="2.4.0" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
    <PackageReference Include="Snowflake.Data" Version="2.1.2" />
    <PackageReference Include="System.Data.Odbc" Version="7.0.0" />
    <PackageReference Include="System.Linq.Async" Version="6.0.1" />
    <PackageReference Include="TimeZoneConverter" Version="6.1.0" />
  </ItemGroup>
martincostello commented 10 months ago

Duplicate of #50836.

ghost commented 10 months ago

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.