TypeLoadException with generic interface declaring generic method

41 views
Skip to first unread message

Fabian Schmied

unread,
Mar 6, 2007, 10:23:19 AM3/6/07
to Rhino.Mocks
Hi,

Another issue with the current RhinoMocks revision from SVN:

System.TypeLoadException: The generic type 'InvocationMethod_11' was
used with the wrong number of generic arguments in assembly
'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture
=neutral, PublicKeyToken=null'.
at IDoubleGeneric`1Proxy309f413febfc481095f519d1eb1df17e.Method[T]
(One one, T two)
at Tests.Test.Execute() in C:\...\Test.cs:line 36

This exception is thrown when calling a generic method on a mock
object with a generic interface, e.g. with the following code:

[TestFixture]
public class Test
{
[Test]
public void Execute ()
{
MockRepository mocks = new MockRepository();
IDoubleGeneric<int> mock =
mocks.CreateMock<IDoubleGeneric<int>>();
Expect.Call(mock.Method(1, ""));
}
}

public interface IDoubleGeneric<One>
{
object Method<T> (One one, T two);
}

(Again, I'm suspecting DynamicProxy 2 to be the culprit.)

Best regards,
Fabian

Ayende Rahien

unread,
Mar 6, 2007, 10:34:23 AM3/6/07
to Rhino...@googlegroups.com
Please try with the Beta 4 version.
I run into an issue committing the latest changes, so it is about a day old in the repository.

michael.r

unread,
Mar 6, 2007, 10:53:55 AM3/6/07
to Rhino.Mocks
Hello Ayende,

The problem definitely exists in Beta 4.

Regards, Michael

On Mar 6, 4:34 pm, "Ayende Rahien" <aye...@ayende.com> wrote:
> Please try with the Beta 4 version.
> I run into an issue committing the latest changes, so it is about a day old
> in the repository.
>

Ayende Rahien

unread,
Mar 9, 2007, 10:09:06 AM3/9/07
to Rhino...@googlegroups.com
Yes, this is a Dynamic Proxy 2 bug.

On 3/6/07, michael.r <michael....@lycos.at> wrote:

Hello Ayende,

The problem definitely exists in Beta 4.

Regards, Michael

On Mar 6, 4:34 pm, "Ayende Rahien" <aye...@ayende.com> wrote:
> Please try with the Beta 4 version.
> I run into an issue committing the latest changes, so it is about a day old
> in the repository.
>
> On 3/6/07, Fabian Schmied <fabian.schm...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > Another issue with the current RhinoMocks revision from SVN:
>
> > System.TypeLoadException: The generic type 'InvocationMethod_11' was
> > used with the wrong number of generic arguments in assembly
> > 'DynamicProxyGenAssembly2, Version= 0.0.0.0, Culture

Ayende Rahien

unread,
Mar 10, 2007, 5:43:53 AM3/10/07
to Rhino...@googlegroups.com
fixed.
Reply all
Reply to author
Forward
0 new messages