After adding the Microsoft.Azure.Cosmos package to my project, I get the following exception when calling builder.Services.AutoRegisterDependencies();:
System.BadImageFormatException
HResult=0x80131018
Message=Could not load file or assembly 'path\to\bin\Debug\net6.0\Cosmos.CRTCompat.dll'. The module was expected to contain an assembly manifest.
Source=System.Private.CoreLib
StackTrace:
at System.Reflection.AssemblyName.nGetFileInformation(String s)
at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile) in System.Reflection\AssemblyName.cs:line 343
at AutoDependencyRegistration.Helpers.RegisterDependenciesHelper.<>c.<GetAssemblies>b__1_0(String x) in AutoDependencyRegistration.Helpers\RegisterDependenciesHelper.cs:line 22
at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext() in System.Linq\Enumerable.cs:line 1762
at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext() in System.Linq\Enumerable.cs:line 2599
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() in System.Linq\Enumerable.cs:line 3354
at AutoDependencyRegistration.Services.RegisterDependenciesService.RegisterServices(IEnumerable`1 services, IServiceCollection serviceCollection) in AutoDependencyRegistration.Services\RegisterDependenciesService.cs:line 24
at WebApplication1.Program.Main(String[] args) in path\to\Program.cs:line 18
You can reproduce it by creating a new Web API (.net 6.0), and add Stax.AutoDependencyInjectionRegistration 3.1.0 and Microsoft.Azure.Cosmos 3.35.4.
It looks like something goes wrong while iterating the services here:
Hey, cool package!
After adding the
Microsoft.Azure.Cosmos
package to my project, I get the following exception when callingbuilder.Services.AutoRegisterDependencies();
:You can reproduce it by creating a new Web API (.net 6.0), and add
Stax.AutoDependencyInjectionRegistration
3.1.0 andMicrosoft.Azure.Cosmos
3.35.4.It looks like something goes wrong while iterating the services here:
Let me know if you need more information :)