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

Assembly resolver static instance makes the assembly resolving wrong in multiple projects scenario #20

Open
xuzhg opened this issue May 25, 2021 · 0 comments

Comments

@xuzhg
Copy link
Member

xuzhg commented May 25, 2021

Short summary (3-5 sentences) describing the issue.

Assemblies affected

Which assemblies and versions are known to be affected e.g. OData ModelBuilder 1.x

Reproduce steps

There's a static instance for the default assembly resolver.
https://github.com/OData/ModelBuilder/blob/master/src/Microsoft.OData.ModelBuilder/Helpers/DefaultAssemblyResolver.cs#L21

In multiple projects scenario, for example there's "v1" and "v2" model builder.

"v1" reference Assembly A, B, C.
"v2" reference Assembly A, B, C, and D.

If we build the V1 first, Default assembly only loads "A, B, C".
When build "v2", since the default assembly statically in memory, it load "A, B, C", then there's no opportunity to load "D".

Expected result

What would happen if there wasn't a bug.

Actual result

What is actually happening.

Additional detail

Work around, create your own AssemblyResolver and input into the convention model builder.

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

1 participant