Skip to content
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

APICompat is failing when being used with desktop msbuild #45004

Open
ViktorHofer opened this issue Nov 21, 2024 · 3 comments
Open

APICompat is failing when being used with desktop msbuild #45004

ViktorHofer opened this issue Nov 21, 2024 · 3 comments
Assignees

Comments

@ViktorHofer
Copy link
Member

    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018: The "Microsoft.DotNet.ApiCompat.Task.ValidatePackageTask" task failed unexpectedly. [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018: System.MissingMethodException: Method not found: 'Void Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions..ctor(Microsoft.CodeAnalysis.OutputKind, Boolean, System.String, System.String, System.String, System.Collections.Generic.IEnumerable`1<System.String>, Microsoft.CodeAnalysis.OptimizationLevel, Boolean, Boolean, System.String, System.String, System.Collections.Immutable.ImmutableArray`1<Byte>, System.Nullable`1<Boolean>, Microsoft.CodeAnalysis.Platform, Microsoft.CodeAnalysis.ReportDiagnostic, Int32, System.Collections.Generic.IEnumerable`1<System.Collections.Generic.KeyValuePair`2<System.String,Microsoft.CodeAnalysis.ReportDiagnostic>>, Boolean, Boolean, Microsoft.CodeAnalysis.XmlReferenceResolver, Microsoft.CodeAnalysis.SourceReferenceResolver, Microsoft.CodeAnalysis.MetadataReferenceResolver, Microsoft.CodeAnalysis.AssemblyIdentityComparer, Microsoft.CodeAnalysis.StrongNameProvider, Boolean, Microsoft.CodeAnalysis.MetadataImportOptions, Microsoft.CodeAnalysis.NullableContextOptions)'. [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018:    at Microsoft.DotNet.ApiSymbolExtensions.AssemblySymbolLoader..ctor(Boolean resolveAssemblyReferences, Boolean includeInternalSymbols) [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018:    at Microsoft.DotNet.ApiSymbolExtensions.AssemblySymbolLoaderFactory.Create(Boolean shouldResolveReferences) [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018:    at Microsoft.DotNet.ApiCompatibility.Runner.ApiCompatRunner.CreateAssemblySymbols(IReadOnlyList`1 metadataInformation, Boolean& resolvedExternallyProvidedAssemblyReferences) [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018:    at Microsoft.DotNet.ApiCompatibility.Runner.ApiCompatRunner.ExecuteWorkItems() [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018:    at Microsoft.DotNet.ApiCompat.ValidatePackage.Run(Func`2 logFactory, Boolean generateSuppressionFile, Boolean preserveUnnecessarySuppressions, Boolean permitUnnecessarySuppressions, String[] suppressionFiles, String suppressionOutputFile, String noWarn, Boolean respectInternals, Boolean enableRuleAttributesMustMatch, String[] excludeAttributesFiles, Boolean enableRuleCannotChangeParameterName, String packagePath, Boolean runApiCompat, Boolean enableStrictModeForCompatibleTfms, Boolean enableStrictModeForCompatibleFrameworksInPackage, Boolean enableStrictModeForBaselineValidation, String baselinePackagePath, String runtimeGraph, IReadOnlyDictionary`2 packageAssemblyReferences, IReadOnlyDictionary`2 baselinePackageAssemblyReferences, String[] baselinePackageFrameworksToIgnore) [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018:    at Microsoft.DotNet.ApiCompat.Task.ValidatePackageTask.ExecuteCore() [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018:    at Microsoft.DotNet.ApiCompat.Task.ValidatePackageTask.Execute() [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Execute() [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
    D:\a\_work\1\vmr\.dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [D:\a\_work\1\vmr\src\aspnetcore\src\WebEncoders\src\Microsoft.Extensions.WebEncoders.csproj]
##[error].dotnet\sdk\10.0.100-alpha.1.24555.54\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets(39,5): error MSB4018: (NETCORE_ENGINEERING_TELEMETRY=Build) The "Microsoft.DotNet.ApiCompat.Task.ValidatePackageTask" task failed unexpectedly.
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-ApiCompat untriaged Request triage from a team member labels Nov 21, 2024
Copy link
Contributor

@dotnet/area-infrastructure-libraries a new issue has been filed in the ApiCompat area, please triage

@ViktorHofer
Copy link
Member Author

cc @ericstj

@ericstj ericstj removed the untriaged Request triage from a team member label Nov 21, 2024
@ericstj
Copy link
Member

ericstj commented Nov 21, 2024

I think that happens when mismatched roslyn is loaded. Did you investigate it - any more repro details @ViktorHofer?

Update - just to see if I could reproduce I tried using the .NET 9 SDK with desktop MSBuild and it worked file. I see from your log that this is using the 10.0 SDK. Probably something regressed with dependencies in 10.0.

My best guess at the root cause is that APICompat is loading a newer version of System.Collections.Immutable than Roslyn is, and MSBuild doesn't have a redirect -- given I see that method signature with System.Collections.Immutable.ImmutableArray`1<Byte>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants