Comments (3)
Thanks for the details especially those in the SO question.
I've worked out this defect only affects CreateClassProxy
and can confirm that it was introduced in 3.2.0 under DYNPROXY-175, which is why 3.1.0 works as you reported.
We don't currently have any unit tests to verify the type
parameter which is why this regression unfortunately has occurred.
This is what type
is for each generator method:
CreateClassProxy
: currently aSystem.RuntimeType
becauseClassProxyTargetContributor
passes through aTypeTokenExpression
CreateClassProxyWithTarget
: aSystem.Type
for the targetCreateInterfaceProxyWithTarget
: aSystem.Type
for the targetCreateInterfaceProxyWithTargetInterface
: aSystem.Type
for the targetCreateInterfaceProxyWithoutTarget
:null
, there is no target
Unfortunately we've also got a mismatch between behaviour and documented behaviour via XML comments. type
is implemented as target type, and method
is implemented as documented, you can get the type declaring the method to intercept via method.DeclaringType
.
public interface IInterceptorSelector
{
/// <summary>
/// Selects the interceptors that should intercept calls to the given <paramref name = "method" />.
/// </summary>
/// <param name = "type">The type declaring the method to intercept.</param>
/// <param name = "method">The method that will be intercepted.</param>
/// <param name = "interceptors">All interceptors registered with the proxy.</param>
...
IInterceptor[] SelectInterceptors(Type type, MethodInfo method, IInterceptor[] interceptors);
}
I'll look at getting a set of unit tests added and the fix.
from core.
Has this issue progressed any further?
from core.
No. I think I've got a patch someone in my Windows VM with a hacky fix from January, but never got back to it, the unit tests are probably the only useful bits.
from core.
Related Issues (20)
- Random VerificationException/TypeLoadException HOT 5
- it's very slow to create proxy HOT 2
- Log4Net not listed in dependencies HOT 4
- `InvalidProgramException` when proxying `MemoryStream` with .NET 7 HOT 15
- Proxy created with CreateClassProxyWithTarget returns false for Equals on itself HOT 3
- Why TransactionInterceptor.Intercept run at the client HOT 2
- System.InvalidOperationException: Operations that change non-concurrent collections must have exclusive access. HOT 1
- `ArgumentException`: "Could not find method overriding method" with overridden class method having generic by-ref parameter HOT 3
- `ArgumentException`: "Cannot create an instance of `TEnum` because `Type.ContainsGenericParameters` is true" caused by `Enum` constraint on method `out` parameter HOT 4
- Proxy fail to create for create substitute that returns a derived class from abstract that satisfies interface implicitly HOT 5
- Release 5.2.0 HOT 1
- Support by-ref-like (`ref struct`) parameter types such as `Span<T>` and `ReadOnlySpan<T>` HOT 10
- Support "with" for record proxies HOT 4
- CreateInterfaceProxyWithoutTarget and BaseTypeForInterfaceProxy-member
- DictionaryAdapter Nesting Dictionaries JSON like
- Allow to intercept IAsyncEnumerable HOT 1
- ProxyGenerator leaking HOT 2
- MissingMethodException when trying to call a proxy target from different project
- .NET 9 compatibility: Signature of the body and declaration in a method implementation do not match HOT 1
- DI behavior change between .NET 7.0 and .NET 8.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.