Skip to content

[Bug]: No way to load NuGet.Frameworks into Default ALC #10228

Description

@hknielsen

Issue Description

While using in-proc BuildManager, theres no way to properly handle NuGet.Frameworks loading.
https://github.com/dotnet/msbuild/blob/main/src/Build/Utilities/NuGetFrameworkWrapper.cs#L56

assemblyName are never set while running in none msbuild.exe or Visual Studio, and as far as I can tell, its loaded into a separate temp ALC, and not the default as the rest of the Microsoft Build assemblies.
Either it should be possible to setup that one want it to be loaded into the Default ALC, or the CurrentReflectionContext ALC.

With this current behavior im having a hard time not having to include the NuGet.Frameworks.dll published, where it needs to be the same version as the NuGet.Frameworks.dll in the dotnet SDK.

Steps to Reproduce

Have ie. ProjectCreator nuget package or other assemblies that depends on Nuget.Frameworks dll.
Use BuildManager In-Proc to restore projects.
If published version dont match as the one in the SDK, theres file load failures.

Have the ability to load the Nuget.Frameworks dll in the Default ALC or CurrentReflectionContext should help

Expected Behavior

NuGet.Frameworks.dll is loaded correctly, either as part as the MSBuild Locator, or in a more controlled ALC setup.

Actual Behavior

NuGet.Frameworks.dll needs to be published, and need to match exact dll version as the dotnet sdk, making it hard on dev machines as dotnet sdk is tied to the local installed version.

Analysis

No response

Versions & Configurations

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions