This is a old thread now, but here is my response anyway because you didn't
reply if you fixed it.

It looks like the assembly under test is not strong named, which means
DynamicProxy will not strong name the proxy assembly. Your attribute would
need to look something like this (without the public key token set):

[assembly:InternalsVisibleTo("DynamicProxyGenAssembly2")]

On Thu, Jun 18, 2009 at 2:29 PM, Tim Barcz <[email protected]> wrote:

> Give access to DynamicProxy
>
>
> On Wed, Jun 17, 2009 at 11:11 PM, [email protected] <
> [email protected]> wrote:
>
>>
>> Internals are already visible to the test assembly. The problem I
>> believe is that internals are not visible to the mocking framework and
>> so it cannot mock those classes/interfaces...
>>
>> On Jun 18, 12:03 pm, Tim Barcz <[email protected]> wrote:
>> > What is the name of your tests....you need to make the internals visible
>> to
>> > you test assembly, not Rhino (I believe).
>> >
>> > Tim
>> >
>> > On Wed, Jun 17, 2009 at 9:42 PM, [email protected]
>> > <[email protected]>wrote:
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > > So I have a bunch of internal classes which I am trying to mock with
>> > > RhinoMocks. I have added the following line to assemblyinfo.cs:
>> >
>> > > [assembly:InternalsVisibleTo(RhinoMocks.StrongName)]
>> >
>> > > However, this still does not allow me to mock internal classes; I get
>> > > the following error message from NUnit:
>> >
>> > > MyTests.SomeTest: System.TypeLoadException : Method 'SomeMethod' on
>> > > type 'SomeType504cf40be6b444abfd417dccf5d6752' from assembly
>> > > 'DynamicProxyGenAssembly2, Version=0.0.0.0, Culture=neutral,
>> > > PublicKeyToken=null' is overriding a method that is not visible from
>> > > that assembly.
>> >
>> > > Note that I am using the 'merged' version of RhinoMocks (rather than
>> > > the download option 'with Castle assemblies'). I don't know how Castle
>> > > was merged into RhinoMocks but shouldn't making my internals visible
>> > > to RhinoMocks, similarly make it visible to Castle (which is part of
>> > > the Rhino.Mocks.dll)?
>> >
>> > > cheers!
>> >
>> > --
>> > Tim Barcz
>> > ASPInsiderhttp://timbarcz.devlicio.ushttp://www.twitter.com/timbarcz
>>
>>
>
>
> --
> Tim Barcz
> ASPInsider
> http://timbarcz.devlicio.us
> http://www.twitter.com/timbarcz
>
>
> >
>


-- 
Jono

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

Reply via email to