-
Notifications
You must be signed in to change notification settings - Fork 458
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
Update Castle.Core dependency to 4.0.0 #235
Changes from 5 commits
e7cfec2
3409023
937ed13
d4b1977
05085ce
42aa1b2
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 |
---|---|---|
|
@@ -189,9 +189,10 @@ private static Assembly LoadAssembly(AssemblyName assemblyName) | |
return Assembly.Load(assemblyName); | ||
} | ||
#endif | ||
public static TAttribute[] GetAttributes<TAttribute>(this MemberInfo item) where TAttribute : Attribute | ||
|
||
public static TAttribute[] GetAttributes<TAttribute>(this MemberInfo item, bool inherit) where TAttribute : Attribute | ||
{ | ||
return (TAttribute[])Attribute.GetCustomAttributes(item, typeof(TAttribute), true); | ||
return (TAttribute[])Attribute.GetCustomAttributes(item, typeof(TAttribute), inherit); | ||
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. I changed this to avoid ambiguity because Castle.Core also has a GetAttributes() extension method, and it passes |
||
} | ||
|
||
/// <summary> | ||
|
@@ -307,7 +308,7 @@ private static AssemblyName GetAssemblyName(string filePath) | |
private static TBase Instantiate<TBase>(Type subtypeofTBase, object[] ctorArgs) | ||
{ | ||
ctorArgs = ctorArgs ?? new object[0]; | ||
var types = ctorArgs.ConvertAll(a => a == null ? typeof(object) : a.GetType()); | ||
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. ConvertAll() extension method from Castle.Core (CollectionExtensions.cs) no longer exists. 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. Have you considered creating a shim in windsor for it? Something like this: https://github.com/cryosharp/fortress/blob/master/src/Fortress.Windsor/Compatibility/EnumerableExtensions.cs#L22 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. Added EnumerableExtensions.cs |
||
var types = ctorArgs.Select(a => a == null ? typeof(object) : a.GetType()).ToArray(); | ||
var constructor = subtypeofTBase.GetConstructor(BindingFlags.Instance | BindingFlags.Public, null, types, null); | ||
if (constructor != null) | ||
{ | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat worrying that
GC.Collect
no longer does what it says on the tin, we've never had a problem with this in the past. Any idea what has changed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, in Debug mode the JIT will choose to keep the local variable alive until the end of the method, so that it can be inspected in the debugger. This is not new, it's likely this test was failing before.