dotnet / dotnet/sdk

GenerateDocumentationAndConfigFiles and sdk-tasks references latest packages and runs during the build

Open
#52,263 4 comments 0 reactions 0 assignees View on GitHub
Area-NetSDK untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

We hit an issue when retargeting to net11 where GenerateDocumentationAndConfigFiles had a mismatch in references.
```
##[error]src/sdk/src/Microsoft.CodeAnalysis.NetAnalyzers/tools/GenerateDocumentationAndConfigFiles/CodeFixerExtensions.cs(42,82): error CS1705: (NETCORE_ENGINEERING_TELEMETRY=Build) Assembly 'System.Composition.AttributedModel' with identity 'System.Composition.AttributedModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' uses 'System.Runtime, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
/__w/1/s/src/sdk/src/Microsoft.CodeAnalysis.NetAnalyzers/tools/GenerateDocumentationAndConfigFiles/CodeFixerExtensions.cs(42,82): error CS1705: Assembly 'System.Composition.AttributedModel' with identity 'System.Composition.AttributedModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' uses 'System.Runtime, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [/__w/1/s/src/sdk/src/Microsoft.CodeAnalysis.NetAnalyzers/tools/GenerateDocumentationAndConfigFiles/GenerateDocumentationAndConfigFiles.csproj]
##[error]CSC(0,0): error CS1705: (NETCORE_ENGINEERING_TELEMETRY=Build) Assembly 'System.Composition.AttributedModel' with identity 'System.Composition.AttributedModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' uses 'System.Runtime, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
CSC : error CS1705: Assembly 'System.Composition.AttributedModel' with identity 'System.Composition.AttributedModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' uses 'System.Runtime, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' [/__w/1/s/src/sdk/src/Microsoft.CodeAnalysis.NetAnalyzers/tools/GenerateDocumentationAndConfigFiles/GenerateDocumentationAndConfigFiles.csproj]
```

By using the latest packages from runtime it consumed binaries that expected the runtime assemblies to have version 11.

The project itself opts-out of referencing the live refpack though. Presumably this is done because this project also runs during the build of SDK where it needs to run on the LKG SDK.

This mismatch can lead to problems - like the one here when we retarget - or cases where packages might depend on new runtime API that is not yet present in the SDK's LKG.

It might be easier to target a non-live framework for this tool (EG: oldest LTS).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.