-
Notifications
You must be signed in to change notification settings - Fork 479
Caliing DynamicProxy proxy methods with multidimensional array parameters #47
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
Conversation
…xyTypeWithMultiDimentionalArrayAsParameter unit test.
…ultiDimentionalArrayAsParameter unit test.
|
Hmm, I think there was a bug in Reflection Emit around multidimensional arrays. Does that mean that's been fixed now, in latest version of .NET ? |
|
I'm not sure. I know that this fix works for a simple use case I set up, On 18 March 2014 21:05, Krzysztof Koźmic notifications@github.com wrote:
|
|
have you tried that on older versions of .NET? version 4 or 3.5 specifically? |
|
I tried on .NET 4 targets with Visual Studio 2012 and 2013. Visual 2012 with the unit test here, where the test method doesn't do anything. Visual 2013 with another simple use case, where I summed 1- and 2-dimensional arrays. In either case, I think the exception was when calling the method, rather than running it or dealing with the return. |
|
here's the bug in Microsofr connect. It's still open https://connect.microsoft.com/VisualStudio/feedback/details/472621/reflection-emit-produces-invalid-siagnatures-of-methods-with-multidimensional-arrays |
|
with that change, does the |
|
I just found http://support.microsoft.com/kb/960240 which is referenced by the link you gave. It's marked as applying to .NET 2.0-3.5SP1, with a note that "Microsoft has recognized this problem, and it is currently planned that a future release of the .NET Framework will include a System.Reflection.Emit namespace that will have corrected this." but no indication whether that happened, and last review in Nov 2008. |
|
Yes, with the change, all unit tests passed for me. |
|
All unit tests pass with NET45-Debug target I should say. |
|
nice, that likely does mean that they've fixed it... :) |
|
Fingers crossed... FWIW, I just ran with NET35-Debug from VS2012 with this pull request to see if I could replicate the bug and the test passed - I guess MS didn't favour backward compatibility for that bug. |
|
ha interesting. Do you mind unignoring the test then? |
Caliing DynamicProxy proxy methods with multidimensional array parameters
|
Oh, wow.. it auto-added the new commit to the pull request and you merged while I was trying to figure out how to add the commits. That's great - thanks very much. And thanks for such a useful project. All the best, Ed. |
|
hehe, it just works :) thanks for the PR. We should be doing a release either later this month, or early next month. |
I noticed that when I created a proxy for an object with a method which takes a 2-dimensional array parameters that the proxy created ok, but when I called the method, that there was an exception due to the proxy method being called with parameter type T[] rather than T[,].
This pull request strengthens the ProxyTypeWithMultiDimentionalArrayAsParameter unit test by actually calling each of the methods of the test class. TypeUtil.GetClosedParameterType is altered so that it returns the correct type for multi-dimensional arrays and the unit test passes. I think that all other unit tests continue to pass.
Hope this helps, Ed.