[RhinoMocks] Re: System.TypeLoadException when using MockRepository

2009-01-19 Thread Colin Desmond

OK, I am happy with that as a solution.

Colin.

On Jan 19, 12:45 pm, Ayende Rahien  wrote:
> The issue is a problem with modopt in the CLR.Since it is the same thing
> from your perspective, please use int
>
> On Mon, Jan 19, 2009 at 5:24 AM, Colin Desmond <
>
> colin.desm...@btopenworld.com> wrote:
>
> > OK,
>
> > If I change the C++/CLI syntax from
>
> > CoreLibrary::Common::IMSMContact^ LoadSMContact(long nId);
>
> > to
>
> > CoreLibrary::Common::IMSMContact^ LoadSMContact(int nId);
>
> > it all works, it doesn't like the long. This is interesting given that
> > "int" and "long" both map to System.Int32!
>
> > Colin
>
> > On Jan 19, 9:32 am, Colin Desmond 
> > wrote:
> > > We're using 3.5 SP1.
>
> > > When I rewrite the interface as C# it is happy. I'll try playing with
> > > the C++/CLI syntax a little and see if I can get it to work.
>
> > > Colin
>
> > > On Jan 18, 9:15 pm, Ayende Rahien  wrote:
>
> > > > what version of the runtime?if you write the same thing in C#, does it
> > cause
> > > > any issues?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: System.TypeLoadException when using MockRepository

2009-01-19 Thread Ayende Rahien
The issue is a problem with modopt in the CLR.Since it is the same thing
from your perspective, please use int

On Mon, Jan 19, 2009 at 5:24 AM, Colin Desmond <
colin.desm...@btopenworld.com> wrote:

>
> OK,
>
> If I change the C++/CLI syntax from
>
> CoreLibrary::Common::IMSMContact^ LoadSMContact(long nId);
>
> to
>
> CoreLibrary::Common::IMSMContact^ LoadSMContact(int nId);
>
> it all works, it doesn't like the long. This is interesting given that
> "int" and "long" both map to System.Int32!
>
> Colin
>
> On Jan 19, 9:32 am, Colin Desmond 
> wrote:
> > We're using 3.5 SP1.
> >
> > When I rewrite the interface as C# it is happy. I'll try playing with
> > the C++/CLI syntax a little and see if I can get it to work.
> >
> > Colin
> >
> > On Jan 18, 9:15 pm, Ayende Rahien  wrote:
> >
> > > what version of the runtime?if you write the same thing in C#, does it
> cause
> > > any issues?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: System.TypeLoadException when using MockRepository

2009-01-19 Thread Colin Desmond

OK,

If I change the C++/CLI syntax from

CoreLibrary::Common::IMSMContact^ LoadSMContact(long nId);

to

CoreLibrary::Common::IMSMContact^ LoadSMContact(int nId);

it all works, it doesn't like the long. This is interesting given that
"int" and "long" both map to System.Int32!

Colin

On Jan 19, 9:32 am, Colin Desmond 
wrote:
> We're using 3.5 SP1.
>
> When I rewrite the interface as C# it is happy. I'll try playing with
> the C++/CLI syntax a little and see if I can get it to work.
>
> Colin
>
> On Jan 18, 9:15 pm, Ayende Rahien  wrote:
>
> > what version of the runtime?if you write the same thing in C#, does it cause
> > any issues?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: System.TypeLoadException when using MockRepository

2009-01-19 Thread Colin Desmond

We're using 3.5 SP1.

When I rewrite the interface as C# it is happy. I'll try playing with
the C++/CLI syntax a little and see if I can get it to work.

Colin

On Jan 18, 9:15 pm, Ayende Rahien  wrote:
> what version of the runtime?if you write the same thing in C#, does it cause
> any issues?
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---



[RhinoMocks] Re: System.TypeLoadException when using MockRepository

2009-01-18 Thread Ayende Rahien
what version of the runtime?if you write the same thing in C#, does it cause
any issues?

On Sun, Jan 18, 2009 at 3:26 PM, colin.desm...@btopenworld.com <
colin.desm...@btopenworld.com> wrote:

>
> I am getting the following runtime error when I try and use RhinoMocks
> 3.5:
>
> System.TypeLoadException: Method 'LoadSMContact' in type
> 'IMSMContactDataProxy51979982d6d54091de2d94490f57' from assembly
> 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral,
> PublicKeyToken=a621a9e7e5c32e69' does not have an implementation.
> at System.Reflection.Emit.TypeBuilder._TermCreateClass(Int32 handle,
> Module module)
> at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
> at System.Reflection.Emit.TypeBuilder.CreateType()
> at
> Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType
> ()
> at
>
> Castle.DynamicProxy.Generators.InterfaceProxyWithTargetGenerator.GenerateCode
> (Type proxyTargetType, Type[] interfaces, ProxyGenerationOptions
> options)
> at
>
> Castle.DynamicProxy.DefaultProxyBuilder.CreateInterfaceProxyTypeWithoutTarget
> (Type theInterface, Type[] interfaces, ProxyGenerationOptions options)
> at
> Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyTypeWithoutTarget
> (Type theInterface, Type[] interfaces, ProxyGenerationOptions options)
> at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget
> (Type theInterface, Type[] interfaces, ProxyGenerationOptions options,
> IInterceptor[] interceptors)
> at Castle.DynamicProxy.ProxyGenerator.CreateInterfaceProxyWithoutTarget
> (Type theInterface, Type[] interfaces, IInterceptor[] interceptors)
> at Rhino.Mocks.MockRepository.MockInterface(CreateMockState
> mockStateFactory, Type type, Type[] extras)
> at Rhino.Mocks.MockRepository.CreateMockObject(Type type,
> CreateMockState factory, Type[] extras, Object[]
> argumentsForConstructor)
> at Rhino.Mocks.MockRepository.DynamicMock(Object[]
> argumentsForConstructor)
> at Rhino.Mocks.MockRepository.GenerateMock(Object[]
> argumentsForConstructor)
> at ModelsUnitTests.Contact.ContactModelTests.TestLoadKnownContact() in
> ContactModelTests.cs: line 48
>
> The interface being mocked has no multi-dimensional arrays:
>
> public interface class IMSMContactData
> {
>void DeleteSMContact(CoreLibrary::Common::IMSMContact^ pMSMContact);
>CoreLibrary::Common::IMSMContact^ LoadSMContact(long nId);
>void SaveSMContact(CoreLibrary::Common::IMSMContact^ pMSMContact);
>
>
> System::Collections::Generic::IEnumerable^
>GetAllSMContacts();
>virtual long FindContactBySerial(System::String^ serialToFind);
> };
>
> This written in C++/CLI but the tests are in C# (no lambdas in C++
> yet :( )
>
> Any ideas?
>
> Thanks
>
> Colin
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to RhinoMocks@googlegroups.com
To unsubscribe from this group, send email to 
rhinomocks+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~--~~~~--~~--~--~---