Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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 2-Feb-13 13:28pm
Edited 2-Feb-13 13:30pm
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 406
1 /\jmot 180
2 Suraj Sahoo | Coding Passion 170
3 Afzaal Ahmad Zeeshan 159
4 BillWoodruff 154
0 OriginalGriff 8,344
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,634
3 Maciej Los 5,024
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 2 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100