Bundle Microsoft.Extensions.DependencyInjection assemblies with connectors #147
+239
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Users with
Reqnroll.Microsoft.Extensions.DependencyInjectionplugin encounterFileNotFoundExceptionforMicrosoft.Extensions.DependencyInjection.Abstractionsv6.0.0. Works in development environments (SDK installed), fails on end-user machines (VS only).Root Cause
Connectors load user test assemblies in isolated AppDomains/AssemblyLoadContexts. Plugin initialization requires Microsoft.Extensions.* assemblies. V1 connector's
AssemblyHelperonly searches test assembly directory; Generic connector'sTestAssemblyLoadContextsearches NuGet cache but may not find assemblies on SDK-less machines.Changes
Connector Projects
Added package references to both V1 (.NET Framework) and Generic (.NET Core) connectors:
Microsoft.Extensions.DependencyInjection6.0.0Microsoft.Extensions.DependencyInjection.Abstractions6.0.0Version 6.0.0 matches all plugin versions (2.x-3.x). NuGet automatically includes transitive dependencies (
Microsoft.Bcl.AsyncInterfaces,System.Runtime.CompilerServices.Unsafe).VSIX Build
GenerateResourceUsePreserializedResources=truetoReqnroll.VisualStudio.Package.csprojSystem.Resources.Extensionspackage referenceDocumentation
Created
Connectors/README-ASSEMBLY-DEPENDENCIES.mddocumenting:Verification
PowerShell:
Assemblies present in VSIX package under
Connectors/Reqnroll-V1/andConnectors/Reqnroll-Generic-net6.0/. Size impact: ~150KB per connector.Original prompt
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft. Extensions.DependencyInjection.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
at Reqnroll.Microsoft.Extensions.DependencyInjection.DependencyInjectionPlugin.CustomizeGlobalDependencies(Object sender, CustomizeGlobalDependenciesEventArgs args)