Repository navigation
Fix the assembly metadata extractor to use the filename instead of the full name #3334
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ public static class AssemblyMetadataExtractor | |
| { | ||
| private static T CreateInstance<T>(this AppDomain domain) | ||
| { | ||
| return (T)domain.CreateInstanceAndUnwrap(typeof(T).Assembly.FullName, typeof(T).FullName); | ||
| return (T)domain.CreateInstanceFromAndUnwrap(Assembly.GetExecutingAssembly().Location, typeof(T).FullName); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add comments why choose the CreateInstanceFromAndUnwrap instead of CreateInstanceAndUnwrap.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because it works when an assembly is renamed? :) There are tests covering this scenario, and I don't see this as a complex change that requires additional explanation. My thought is adding a comment is too much, but can add it if we think it's necessary.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given nuget.exe is ILMerged, it probably doesn't matter, but would keeping the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically yeah, if anyone ever moves these types around it would be safer, but there's a test to catch this. If you care I can change it but I'd reallly hate to try to fight with CI because of a change like that :D lmk, this merge is not time critical so we can go through the CI churn if necessary.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zivkan Do you care about this or should I merge? |
||
| } | ||
|
|
||
| public static AssemblyMetadata GetMetadata(string assemblyPath) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.