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

(GH-769) API - Resolve Merged Assemblies #776

Conversation

ferventcoder
Copy link
Member

@ferventcoder ferventcoder commented Jun 4, 2016

When using the API, it should resolve merged assemblies but it may
not if there is an assembly handler registered. Before loading up
code that resolves external assemblies, register an AssemblyResolve
handler with the purpose of determining if the assembly has
Chocolatey's Public Key token or not. If it does, use Chocolatey's
merged assembly instead of the conflicting assembly.

Closes #769

When using the API, it should resolve merged assemblies but it may
not if there is an assembly handler registered. Before loading up
code that resolves external assemblies, register an AssemblyResolve
handler with the purpose of determining if the assembly has
Chocolatey's Public Key token or not. If it does, use Chocolatey's
merged assembly instead of the conflicting assembly.
@ferventcoder
Copy link
Member Author

@RichiCoder1 can you take a look at this? I'm not sure if you can build it for testing though, since the keys will be different.

@RichiCoder1
Copy link
Member

Does this also include changes that cause all merged assemblies to have choco's public key? The issue was that choco was trying to activate a type that was in "System.Reactive.PlatformServices" with it's own public key and was picking up mine instead of the one in choco.

var requestedAssembly = new AssemblyName(args.Name);
if (requestedAssembly.get_public_key_token().is_equal_to(ApplicationParameters.OfficialChocolateyPublicKey))
{
return typeof(Lets).Assembly;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RichiCoder1 It's checking the public key token of the requested assembly - meaning that when choco is pulling an item is has merged in, the keys will match. So it will use the internal instead of an external conflicting Assembly. Does this answer your question?

@ferventcoder ferventcoder merged commit 29de194 into chocolatey:stable Jun 5, 2016
@ferventcoder ferventcoder deleted the ticket/stable/GH-769-assembly-handler branch June 5, 2016 03:11
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.

None yet

2 participants