Description
When a test project references a class library tested project that in turn references another class library project, all of them targeting .NET Framework 4.8 and using SDK-style project, the call to ArchLoader.Build() causes exception:
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
If the tested project doesn't reference the other project, it works fine.
See details in the README of the minimal repo that I have created to show the problem:
https://github.com/carlos-quintero/ArchUnitNET-mscorlib-problem/blob/main/README.md
Minimal Working Example
See minimal repo that reproduces the problem:
https://github.com/carlos-quintero/ArchUnitNET-mscorlib-problem/tree/main
Expected Behavior
No exception in project TestsB.
Is this a bug or am I missing something? Any fix / workaround?
Actual Behavior
Message:
Test method TestsB.Tests.TestB threw exception:
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Stack Trace:
BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
DefaultAssemblyResolver.Resolve(AssemblyNameReference name)
MetadataResolver.Resolve(TypeReference type)
TypeReference.Resolve()
MonoCecilTypeExtensions.IsAttribute(TypeDefinition typeDefinition)
DomainResolver.GetOrCreateTypeInstanceFromTypeDefinition(TypeDefinition typeDefinition, Boolean isStub)
DomainResolver.GetOrCreateFieldMember(IType type, FieldReference fieldReference)
WhereSelectEnumerableIterator`2.MoveNext()
<ConcatIterator>d__59`1.MoveNext()
<ConcatIterator>d__59`1.MoveNext()
WhereEnumerableIterator`1.MoveNext()
EnumerableExtensions.ForEach[T](IEnumerable`1 source, Action`1[] actions)
TypeProcessor.AddMembers(ITypeInstance`1 typeInstance, TypeDefinition typeDefinition, DomainResolver domainResolver)
ArchBuilder.<ProcessTypes>b__9_0(ValueTuple`2 entry)
<>c__DisplayClass7_0`3.<CombineSelectors>b__0(TSource x)
WhereSelectEnumerableIterator`2.MoveNext()
List`1.InsertRange(Int32 index, IEnumerable`1 collection)
ArchBuilder.ProcessTypes()
ArchBuilder.Build(Boolean skipRuleEvaluationCache, Boolean skipArchitectureCache)
ArchLoader.Build()
ArchUnitNET Version
0.13.4
.NET Version
.NET Framework 4.8
Additional Context
No response
Description
When a test project references a class library tested project that in turn references another class library project, all of them targeting .NET Framework 4.8 and using SDK-style project, the call to
ArchLoader.Build()causes exception:If the tested project doesn't reference the other project, it works fine.
See details in the README of the minimal repo that I have created to show the problem:
https://github.com/carlos-quintero/ArchUnitNET-mscorlib-problem/blob/main/README.md
Minimal Working Example
See minimal repo that reproduces the problem:
https://github.com/carlos-quintero/ArchUnitNET-mscorlib-problem/tree/main
Expected Behavior
No exception in project TestsB.
Is this a bug or am I missing something? Any fix / workaround?
Actual Behavior
ArchUnitNET Version
0.13.4
.NET Version
.NET Framework 4.8
Additional Context
No response