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

Use LoadFile() and resolve dependencies manually #141

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

gabriel-samfira
Copy link
Member

LoadFile() works on both dotnet Framework 47 and dotnet Core. The downside is that we need to manually resolve dependencies for the custom serializer assembly on dotnet Core. On dotnet Framework there seems to be different behavior in terms of assembly resolution, and as long as the required assembly is in the same folder as the requesting assembly, it loads fine.

LoadFile() works on both dotnet Framework 47 and dotnet Core. The downside is
that we need to manually resolve dependencies for the custom serializer
assembly on dotnet Core. On dotnet Framework there seems to be different behavior
in terms of assembly resolution, and as long as the required assembly is in the
same folder as the requesting assembly, it loads fine.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
@gabriel-samfira
Copy link
Member Author

CC @splatteredbits

I took your advice and went with LloadFile() in the end. Dependency resolution rules are such a mess. On .Net Framework, LoadFile() seems to have automatic resolution. In fact, registering a handler for the AssemblyResolve() event on Windows Server 2016, breaks when running inside a Start-Job script block.

On dotnet core however, this handler is absolutely needed.

Let me know if you have any thoughts on this PR or if you see anything really funky.

@gabriel-samfira
Copy link
Member Author

merging this. Will revert before release if it turns out to be a bad idea.

@gabriel-samfira gabriel-samfira merged commit cc9cf5a into cloudbase:master Aug 28, 2024
7 checks passed
@gabriel-samfira gabriel-samfira deleted the use-load-file branch August 28, 2024 15:31
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

Successfully merging this pull request may close these issues.

1 participant