Skip to content

OpenAPI source generators broken despite correct setup after update to .NET 10.0-rc1 #63623

@Atulin

Description

@Atulin

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I tried to get the output in English, but every single method I could find failed miserably, so here's the build output in Polish. Enjoy:

❯ $Env:DOTNET_CLI_UI_LANGUAGE = "en" & dotnet build
Przywróć zakończono powodzeniem, z ostrzeżeniami w liczbie: 5 w 0,3s
    F:\VS Projects\Ogma3\Ogma3\Ogma3.csproj : warning NU1510: Microsoft.Extensions.DependencyInjection.Abstractions PackageReference nie zostaną oczyszczone. Rozważ usunięcie tego pakietu z zależności, ponieważ prawdopodobnie jest on niepotrzebny.
    F:\VS Projects\Ogma3\Ogma3\Ogma3.csproj : warning NU1510: Microsoft.Extensions.FileProviders.Embedded PackageReference nie zostaną oczyszczone. Rozważ usunięcie tego pakietu z zależności, ponieważ prawdopodobnie jest on niepotrzebny.
    F:\VS Projects\Ogma3\Ogma3\Ogma3.csproj : warning NU1510: Microsoft.Extensions.Logging.Debug PackageReference nie zostaną oczyszczone. Rozważ usunięcie tego pakietu z zależności, ponieważ prawdopodobnie jest on niepotrzebny.
    F:\VS Projects\Ogma3\Ogma3\Ogma3.csproj : warning NU1510: System.Text.Json PackageReference nie zostaną oczyszczone. Rozważ usunięcie tego pakietu z zależności, ponieważ prawdopodobnie jest on niepotrzebny.
    F:\VS Projects\Ogma3\Ogma3\Ogma3.csproj : warning NU1903: Pakiet „Microsoft.NETCore.Jit” 1.0.2 ma znane wysoka luki w zabezpieczeniach o ważności, https://github.com/advisories/GHSA-xcvr-qv8h-m7xw
    info NETSDK1057: Korzystasz z wersji zapoznawczej platformy .NET. Zobacz: ttps://aka.ms/dotnet-support-policy
  Ogma3.ServiceDefaults powodzenie (0,0s) → F:\VS Projects\Ogma3\Ogma3.ServiceDefaults\bin\Debug\net10.0\Ogma3.ServiceDefaults.dll
  Utils powodzenie (0,1s) → F:\VS Projects\Ogma3\Utils\bin\Debug\net10.0\Utils.dll
  Ogma3 zakończono niepowodzeniem, z błędami w liczbie: 2 i ostrzeżeniami w liczbie: 6 (2,0s)
    F:\VS Projects\Ogma3\Ogma3\Ogma3.csproj : warning NU1510: Microsoft.Extensions.DependencyInjection.Abstractions PackageReference nie zostaną oczyszczone. Rozważ usunięcie tego pakietu z zależności, ponieważ prawdopodobnie jest on niepotrzebny.
    F:\VS Projects\Ogma3\Ogma3\Ogma3.csproj : warning NU1510: Microsoft.Extensions.FileProviders.Embedded PackageReference nie zostaną oczyszczone. Rozważ usunięcie tego pakietu z zależności, ponieważ prawdopodobnie jest on niepotrzebny.
    F:\VS Projects\Ogma3\Ogma3\Ogma3.csproj : warning NU1510: Microsoft.Extensions.Logging.Debug PackageReference nie zostaną oczyszczone. Rozważ usunięcie tego pakietu z zależności, ponieważ prawdopodobnie jest on niepotrzebny.
    F:\VS Projects\Ogma3\Ogma3\Ogma3.csproj : warning NU1510: System.Text.Json PackageReference nie zostaną oczyszczone. Rozważ usunięcie tego pakietu z zależności, ponieważ prawdopodobnie jest on niepotrzebny.
    F:\VS Projects\Ogma3\Ogma3\Ogma3.csproj : warning NU1903: Pakiet „Microsoft.NETCore.Jit” 1.0.2 ma znane wysoka luki w zabezpieczeniach o ważności, https://github.com/advisories/GHSA-xcvr-qv8h-m7xw
    F:\VS Projects\Ogma3\Ogma3\obj\Generated\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(596,10): error CS9137: Funkcja „interceptory” nie jest włączona w tej przestrzeni nazw. Dodaj „<InterceptorsNamespaces>$(InterceptorsNamespaces);Microsoft.AspNetCore.OpenApi.Generated</InterceptorsNamespaces>” do swojego projektu.
    F:\VS Projects\Ogma3\Ogma3\obj\Generated\Microsoft.AspNetCore.OpenApi.SourceGenerators\Microsoft.AspNetCore.OpenApi.SourceGenerators.XmlCommentGenerator\OpenApiXmlCommentSupport.generated.cs(597,10): error CS9137: Funkcja „interceptory” nie jest włączona w tej przestrzeni nazw. Dodaj „<InterceptorsNamespaces>$(InterceptorsNamespaces);Microsoft.AspNetCore.OpenApi.Generated</InterceptorsNamespaces>” do swojego projektu.
    F:\VS Projects\Ogma3\Ogma3\Data\Notifications\NotificationsRepository.cs(18,3): warning ASPDEPR006: 'Element „IActionContextAccessor” jest przestarzały: „IActionContextAccessor is obsolete and will be removed in a future version. For more information, visit https://aka.ms/aspnet/deprecate/006.”

Kompiluj zakończono niepowodzeniem, z błędami w liczbie: 2 i ostrzeżeniami w liczbie: 11 w 2,9s

(also, you have a typo there. Should be "kompilacja zakończona niepowodzeniem", not "kompiluj zakończono niepowodzeniem")

The gist of it is that, apparently, I need to add <InterceptorNamespaces> to my .csproj. Simple fix, if not for the fact, that... the desired line is already there.

<Project Sdk="Microsoft.NET.Sdk.Web">
	<PropertyGroup>	
		<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
		<NeutralLanguage>en</NeutralLanguage>
		<EnableNETAnalyzers>true</EnableNETAnalyzers>
		<AnalysisLevel>latest</AnalysisLevel>
		<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
		<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)Generated</CompilerGeneratedFilesOutputPath>
		<EnableEnumGeneratorInterceptor>true</EnableEnumGeneratorInterceptor>
		<InterceptorsNamespaces>$(InterceptorsNamespaces);Microsoft.AspNetCore.OpenApi.Generated;Microsoft.Extensions.Logging.AutoLoggerMessage</InterceptorsNamespaces>
	</PropertyGroup>

Expected Behavior

Everything works just fine. Not just because <InterceptorNamespaces> should be necessary by now, but also because what is supposed to be there, is there.

Steps To Reproduce

Not sure how to create a minimal reproduction. I can't find a way to force this issue to exist.

Exceptions (if any)

No response

.NET Version

10.0.100-rc.1.25451.107

Anything else?

Directory.Build.props

<Project>
	<PropertyGroup>
		<TargetFramework>net10.0</TargetFramework>
		<LangVersion>14</LangVersion>
		<Nullable>enable</Nullable>
		<ImplicitUsings>true</ImplicitUsings>
	</PropertyGroup>

	<ItemGroup>
		<AdditionalFiles Include="$(SolutionDir)/BannedSymbols.txt" />
	</ItemGroup>
</Project>

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-openapi

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions