views:

50

answers:

2

Hello,

I have declared an interface in C++/CLI and made it assembly(DLL). Now I want that interface to be implement by C# app. I have added the reference but still my C# assembly does not detecting my C++/CLI interface and says "Could not found: Are you missing some assembly refernce......"

How to solve this issue?

Regards Usman

A: 

Make sure that the interface class is declared public in the C++/CLI assembly. I recommend the free version of Red Gate .NET Reflector for viewing visibility of types in a compiled assembly.

Ben Voigt
yes everything declared public in C++/CLI assembly. as this is an interfaceso i just declared public class interface and not wrapped inside it in any namespace. I wrapped after but still not recognizing namespace and interfaces declared inside. I used this interface in C++/CLI assembly successfully butnot working in C#
Usman
.NET Reflector not showing C++/CLI assembly(in which interface declared) as reference. but C++/CLI assembly(which one implementing interface as well) properly showing assembly as reference. Strange behaviour in .NET framework.
Usman
Did you use the `interface class` keyword when declaring the interface? C# can only see managed types, while C++/CLI can see and use both managed and native types.
Ben Voigt
A: 

Is the interface defined within a namespace within the C++/CLI assembly? If so have you put 'using [namespace]' at the top of your C# file?

James Gaunt
it says same error : "Are you missing some assembly reference...."By defining interface in namespace, adding using [namespace] and including .dll as reference assembly , still its unable to see that interface.
Usman