Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,



I have tried to build a project with Sharpdevelop, which references namespaces in a different parallel project.

I added "reference" to the project file of the external namespace and I added a IMPORTS statement in the local file.

I receive the message

Namespace or type specified in the project-level Imports .. doesn´t contain any public member or can not be found ...

By building in a fault into the external project file and in one of the vb source files, I could verify that there is NO access to the source!

Why..... what is missing.

I entered the path in the imports of the project file... no effect.

I entered the path under refernce path in the project via the tab "project options" and did not see anz new entry or any change ?!

I am frustrated ?!



Herbert
Posted
Updated 2-Feb-13 12:30pm
v2

1 solution

I cannot see from your description what exactly did you do wrong, but, at this moment, it does not make sense, because you apparently your understanding of things is wrong. You need to fix your understanding first, and, if you do, you will know yourself what to do.

There is no such thing as "reference a namespace". You do only one essential thing: you reference an assembly by some other assembly. Assembly is the fundamental notion of .NET. When an assembly is referenced in other assembly, it get access to all public declarations of the referenced assembly. (Non-public declaration can still be accessed using Reflection, but this is a different story.)

In this relationship between assemblies, namespaces are totally irrelevant.

Namespaces do not control access in any sense of this word, they only define how top-level declarations are named. You might be able to understand it all at once, if I tell you: you don't really need the import directive, which is nothing more than a matter of convenience. If you don't use import, you can simply name all top-level types by their full (fully-qualified) names.

It is important to understand that assemblies and namespaces are unrelated. The same assembly can declare types under one, two or more namespaces. The same namespace can be declared in different assemblies, even if those assemblies are used together. Unrelated is unrelated.

That's all you need to know. Now you can sort out your problem, whatever it is.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900