Skip to content

Conversation

@akoeplinger
Copy link
Member

In dotnet/arcade#14172 we were seeing this issue:

Processing binlog artifacts/log/Debug/Build.binlog into solution at directory .source-index/stage1output
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Microsoft.SourceBrowser.BinLogParser.BinLogCompilerInvocationsReader.<>c__DisplayClass1_0.<ExtractInvocations>b__0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.SourceBrowser.BinLogParser.BinLogCompilerInvocationsReader.ExtractInvocations(String binLogFilePath) in D:\a\_work\1\s\src\SourceBrowser\src\BinLogParser\BinLogReader.cs:line 63
   at BinLogToSln.Program.Main(String[] args) in D:\a\_work\1\s\src\SourceBrowser\src\BinLogToSln\Program.cs:line 77

The reason is that the latest version of MSBuild.StructuredLogger depends on Microsoft.Build.Framework 17.5.0, which only ships with net7.0 and net4.7.2 implementation assemblies, but the BinLogToSln tool is targeting net6.0. We didn't see build issues because we're suppressing the NU1701 warning.

To fix this, move to net8.0 for the projects and use Central Package Management. We bump all MSBuild dependencies to 17.5.0 and also stop targeting netstandard2.0 for Common.csproj and BinLogParser.csproj, this allows us to remove the NU1701 suppression and ensures we're getting correct dependencies.

I'm planning on upstreaming the CPM change to https://github.com/KirillOsenkov/SourceBrowser later.

Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

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

SWEET! 👍

@ViktorHofer
Copy link
Member

@garath this unblocks dotnet/arcade#14172 and we want to get that in asap. Does this change look good to you?

@ViktorHofer ViktorHofer merged commit 1304f78 into dotnet:main Dec 13, 2023
@ViktorHofer
Copy link
Member

@garath is out right now so I'm merging this in. We will follow-up on potential post feedback. We might need to update the app service to net8.0 now.

@ericstj
Copy link
Member

ericstj commented Jun 21, 2024

I think there are more package references we can exclude here. I suspect most of those should be loaded from MSBuild and not the app - so long as our repo's CPM versions don't lift them up.

@akoeplinger akoeplinger deleted the upgrade-net8 branch June 21, 2024 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants