namespace conflict on Castle.Core.Interceptor.IInterceptor and Rhino Mocks 3.5

50 views
Skip to first unread message

Ryan Scott

unread,
Jun 30, 2008, 11:53:45 AM6/30/08
to Rhino Tools Dev
Hi all,
I'm trying to use rhino mocks to test a custom
Castle.Core.Interceptor.IInterceptor implementation.

I'm getting an ambiguous match compilation error when I reference the
assemblies Castle.Core and Rhino.Mocks 3.5. It looks like the problem
is because I'm mocking IInvocation, which is marked public in RM 3.5
and internal in RM 3.4. I've had to revert back to RM version 3.4
where IInvocation was marked internal.

Does anyone have a suggestion on how to resolve this and still use
3.5? Why was IInvocation made public?

Thanks,
Ryan Scott

Ayende Rahien

unread,
Jun 30, 2008, 1:37:49 PM6/30/08
to rhino-t...@googlegroups.com
A patch to make it internal would be welcome (see ilmerge.exclue)

Ayende Rahien

unread,
Jun 30, 2008, 1:53:15 PM6/30/08
to rhino-t...@googlegroups.com
A patch to make it internal would be welcome (see ilmerge.exclue)

On Mon, Jun 30, 2008 at 6:53 PM, Ryan Scott <rsco...@gmail.com> wrote:

Ryan Scott

unread,
Jun 30, 2008, 1:54:57 PM6/30/08
to Rhino Tools Dev
It looks like the line was explicitly added to ilmerge.exclude in
revision 1393. I'd prefer to have it removed from ilmerge.exclude but
I don't want to step on someone else's change. Does anyone know why
it was made public in the first place?

On Jun 30, 12:37 pm, "Ayende Rahien" <aye...@ayende.com> wrote:
> A patch to make it internal would be welcome (see ilmerge.exclue)
>

Roelof Blom

unread,
Jun 30, 2008, 5:10:29 PM6/30/08
to rhino-t...@googlegroups.com
The tests won't compile without that line.

Ayende Rahien

unread,
Jun 30, 2008, 8:14:49 PM6/30/08
to rhino-t...@googlegroups.com
You can use assembly names to handle that.
global::Foo.Bar
rhino::Foo.Bar

Ryan Scott

unread,
Jul 1, 2008, 9:42:23 AM7/1/08
to Rhino Tools Dev
The :: operator doesn't seem to work in this case. You can't specify
an assembly::whateveronly global::whatever. What about using
System.Runtime.CompilerServices.InternalsVisibleToAttribute to handle
the test project while keeping IInvocation internal?

Thanks,
Ryan

On Jun 30, 7:14 pm, "Ayende Rahien" <aye...@ayende.com> wrote:
> You can use assembly names to handle that.
> global::Foo.Bar
> rhino::Foo.Bar
>
> On Tue, Jul 1, 2008 at 12:10 AM, Roelof Blom <roelof.b...@gmail.com> wrote:
> > The tests won't compile without that line.
>

Ryan Scott

unread,
Jul 1, 2008, 9:55:05 AM7/1/08
to Rhino Tools Dev
Dang. That won't work. Rhino Mocks isn't aware of the test project
at compile time, so the InternalsVisibleTo won't work.

Ryan Scott

unread,
Jul 1, 2008, 10:01:20 AM7/1/08
to Rhino Tools Dev
The namespace alias qualifier works once I add the alias to the
assembly in my project file. Thanks for the suggestion.

Ayende Rahien

unread,
Jul 1, 2008, 10:28:48 AM7/1/08
to rhino-t...@googlegroups.com
Yes.
I think that this is going to be the workaround for this

Ryan Scott

unread,
Jul 1, 2008, 10:35:02 AM7/1/08
to Rhino Tools Dev
For reference, resharper still thinks it's an ambiguous reference. It
compiles fine, but R# thinks it's an error. I've opened a JIRA issue
with JetBrains.

http://www.jetbrains.net/jira/browse/RSRP-73777

Thanks,
Ryan Scott

On Jul 1, 9:28 am, "Ayende Rahien" <aye...@ayende.com> wrote:
> Yes.
> I think that this is going to be the workaround for this
>
Reply all
Reply to author
Forward
0 new messages