A
A
Avery0072013-11-19 18:07:12
C++ / C#
Avery007, 2013-11-19 18:07:12

Why is a class from a dll declared only if a namespace is written before it?

I made a dll. Through add link, I added it as a project.
Connected the namespace through using. But to declare a class, you need to write Namespace.ClassName = new Namespace.ClassName. It is very uncomfortable.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Vishnyakov, 2013-11-20
@Avery007

If your class position is approximately Namespace.Namespace.Class, then you need to write
using Namespace.Namespace.
You can also use using ClassName = Namespace.ClassName.
But in general this is bad practice. Here is a link for further study.

A
Alexander Kosheverov, 2013-11-19
@Iworb

Write 1 more using, which will contain <dll name>.<namespace>

A
Avery007, 2013-11-20
@Avery007

Found a solution from the link. Registered using inside the namespace in the main project. Thanks a lot.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question