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

ResidesInAssembly loading System.* #302

Closed
AdrianoAE opened this issue Sep 8, 2024 · 3 comments
Closed

ResidesInAssembly loading System.* #302

AdrianoAE opened this issue Sep 8, 2024 · 3 comments
Assignees

Comments

@AdrianoAE
Copy link

AdrianoAE commented Sep 8, 2024

When verifying types from assemblies, the base types are being considered

IArchRule rule = Types()
	.That().ResideInAssembly(_DOMAIN_ASSEMBLY)
	.Should().NotDependOnAnyTypesThat().ResideInAssembly(_API_ASSEMBLY);

_ARCHITECTURE.CheckRule(rule);

Expected: Success because there is no reference between the projects

Actual:

ArchUnitNET.xUnit.FailedArchRuleException : "Types that reside in assembly "Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" should not depend on any types that reside in assembly "Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"" failed:
	Domain.MyClass1 does depend on System.Runtime.CompilerServices.IsReadOnlyAttribute and System.IEquatable`1 and System.TimeSpan and System.TimeSpan& and System.Boolean and System.String and System.Object and System.Int32 and System.Collections.Generic.EqualityComparer`1

Same thing for the opposite rule with DependOnAnyTypesThat(). BCL and FCL types should not be taken into consideration since they are no declared in the given assembly

@alexanderlinne alexanderlinne self-assigned this Oct 10, 2024
@alexanderlinne
Copy link
Collaborator

Hi @AdrianoAE, this seems to be a bug where types are assigned the wrong origin assembly. I've created #312 which I'd expect to solve your issue. Would be great if you'd be able to test this once we've merged it.

@alexanderlinne
Copy link
Collaborator

Hi @AdrianoAE, we've just published version 0.11.3-preview.1. Would you be able to check whether this fixes your issue? Otherwise, an example that reproduces your specific issue would be necessary.

@AdrianoAE
Copy link
Author

Hello, I'm sorry at the time I just rewrote my code to use Roslyn so do not have the original code anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants