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

Microsoft.CodeAnalysis.Workspaces.MSBuild nuget package is missing reference to Microsoft.Extensions.Logging #72938

Closed
akoeplinger opened this issue Apr 8, 2024 · 4 comments
Labels
Area-Infrastructure Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@akoeplinger
Copy link
Member

Version Used: 4.10.0-3.24202.15

In dotnet/hotreload-utils#379 we hit an exception when upgrading from 4.9 to 4.10 Roslyn:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Logging, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

File name: 'Microsoft.Extensions.Logging, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
   at Microsoft.CodeAnalysis.MSBuild.DiagnosticReporterLoggerProvider.CreateLoggerFactoryForDiagnosticReporter(DiagnosticReporter reporter)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace..ctor(HostServices hostServices, ImmutableDictionary`2 properties)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create(IDictionary`2 properties, HostServices hostServices)
   at Microsoft.CodeAnalysis.MSBuild.MSBuildWorkspace.Create(IDictionary`2 properties)
   at Microsoft.DotNet.HotReload.Utils.Generator.BaselineProject.PrepareMSBuildProject(Config config, EditAndContinueCapabilities capabilities, CancellationToken ct)
   at Microsoft.DotNet.HotReload.Utils.Generator.BaselineProject.Make(Config config, EditAndContinueCapabilities capabilities, CancellationToken ct)
   at Microsoft.DotNet.HotReload.Utils.Generator.Runner.SetupBaseline(EditAndContinueCapabilities capabilities, CancellationToken ct)
   at Microsoft.DotNet.HotReload.Utils.Generator.Runner.Run(CancellationToken ct)

Looking at the .nuspec of Microsoft.CodeAnalysis.Workspaces.MSBuild I saw that it is referencing only Microsoft.Extensions.Logging.Abstractions, but not Microsoft.Extensions.Logging.

The latter assembly is referenced since 19751d7 because LoggerFilterOptions is contained in Microsoft.Extensions.Logging, not .Abstractions:

new LoggerFilterOptions() { MinLevel = LogLevel.Warning });

We presumably need to update the package dependency here:

<!-- These PackageReferences aren't needed for the compiler for this project, but ensure correct NuGet packaging. Since we're bundling the BuildHost in lib/, we need to
ensure we include the references it needs, but since it's PrivateAssets="true" they don't flow into this package's package references when packaging. -->
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />

/cc @jasonmalinowski @dibarbet

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 8, 2024
@CyrusNajmabadi
Copy link
Member

tagging @JoeRobich as well.

@akoeplinger
Copy link
Member Author

akoeplinger commented May 13, 2024

Ping. I can send a PR to fix the nuget reference but I'm not sure depending on the non-abstraction package was intentional.

@dibarbet
Copy link
Member

Believe this was fixed by #73393, should be in the 17.11 packages

@dibarbet dibarbet added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 19, 2024
@dibarbet dibarbet added this to the 17.11 P2 milestone Jun 19, 2024
@akoeplinger
Copy link
Member Author

akoeplinger commented Jun 20, 2024

I can confirm this is fixed in 17.11 packages, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

3 participants