views:

82

answers:

1

I am using the VS debuggers 'Immediate Window' to call a static API on a class which is an ambiguous type defined in 2 different assemblies.

The call fails with the following message: The type exists in both and

This message makes sense since this is indeed the case. My question is how can I work around this in the debugger to specify which assembly I want to be used for binding this type?

Is there a way to qualify a type with the assembly name that it is defined in?

Thanks Bhavin.

A: 

It sounds like you have two types which have the same name and namespace but live in different assemblies? If that is the case, unfortunately there is no way to disambiguate this call in the immediate window. The immediate window considers both of these types to be in scope and since assembly name cannot be a part of the cast syntax in C# or VB.Net there is no way to disambiguate these types.

The only option you have is to create an alternate debug only API which binds to one or the other. Then call this during the debugging session.

JaredPar