Skip to content

Conversation

@tmds
Copy link
Member

@tmds tmds commented Feb 13, 2023

When DotNetBuildFromSource is set, RegularExpressions.Generator uses MicrosoftCodeAnalysis 4.6, and this test project references that project, and uses MicrosoftCodeAnalysis 4.4. The project fails to compile with:

CSC : error CS1705: Assembly 'System.Text.RegularExpressions.Generator' with identity 'System.Text.RegularExpressions.Generator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' uses 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'Microsoft.CodeAnalysis' with identity 'Microsoft.CodeAnalysis, Version=4.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' [/home/tmds/repos/runtime/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj::TargetFramework=net8.0]

cc @ViktorHofer @jkoritzinsky

…RegularExpressions.Generator when DotNetBuildFromSource.
@ghost ghost added area-System.Text.RegularExpressions community-contribution Indicates that the PR has been added by a community member labels Feb 13, 2023
@ghost
Copy link

ghost commented Feb 13, 2023

Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

Issue Details

When DotNetBuildFromSource is set, RegularExpressions.Generator uses MicrosoftCodeAnalysis 4.6, and this test project references that project, and uses MicrosoftCodeAnalysis 4.4. The project fails to compile with:

CSC : error CS1705: Assembly 'System.Text.RegularExpressions.Generator' with identity 'System.Text.RegularExpressions.Generator, Version=42.42.42.42, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' uses 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' which has a higher version than referenced assembly 'Microsoft.CodeAnalysis' with identity 'Microsoft.CodeAnalysis, Version=4.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' [/home/tmds/repos/runtime/src/libraries/System.Text.RegularExpressions/tests/FunctionalTests/System.Text.RegularExpressions.Tests.csproj::TargetFramework=net8.0]

cc @ViktorHofer @jkoritzinsky

Author: tmds
Assignees: -
Labels:

area-System.Text.RegularExpressions, community-contribution

Milestone: -

@tmds
Copy link
Member Author

tmds commented Feb 13, 2023

When DotNetBuildFromSource is set, RegularExpressions.Generator uses MicrosoftCodeAnalysis 4.6

The version changed from 4.4 to 4.6 due to #81561.

@ViktorHofer I've just added #81480 and it already failed with this. I think/hope that is an unlucky coincidence. I plan to change our (Red Hat) internal CI to build with DotNetBuildFromSource=true. I'll find out how maintainable it is.


<!-- Remove once the repo moves to a sufficiently high-enough version for file-scoped types -->
<MicrosoftCodeAnalysisVersion>4.4.0-1.22356.23</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisVersion Condition="'$(DotNetBuildFromSource)' != 'true'">4.4.0-1.22356.23</MicrosoftCodeAnalysisVersion>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We got file-scoped types with .NET 7. Is this property still needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't be needed anymore.

@ViktorHofer ViktorHofer merged commit 68fa4da into dotnet:main Feb 14, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Text.RegularExpressions community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants