Namespace with managed C++ DLL and C# usage

  • Thread starter Thread starter Mr Topom
  • Start date Start date
M

Mr Topom

Hi,

Just a simple question :

I have a managed C++ dll;
I want to use it in a C# application.
So I added : #using MyAssembly.SubAssembly; (which is the assembly in
the DLL)

But when I want to use my class : MyAssembly.SubAssembly.Klass, I need
to put all the namespace and the class name alone is not recognized...

Any idea why ?

Thx
 
I have a managed C++ dll;
I want to use it in a C# application.
So I added : #using MyAssembly.SubAssembly; (which is the assembly in
the DLL)

ahh... you mean #using "MyAssembly.SubAssembly.DLL"?
But when I want to use my class : MyAssembly.SubAssembly.Klass, I need
to put all the namespace and the class name alone is not recognized...

Any idea why ?

Sure. You just referenced the assembly, not the namespace (which has nothing
to do with it). If you want to avoid specifying the namespace everytime,
then just add a using namespace directive as well:

using namespace MyAssembly::SubAssembly;
 
Back
Top