Can I have
namespace somenamespace
{
//references functionality in DLL_1
namespace somesubnamespace
{
//references functionality in DLL_2
}
}
And if I do this, when I use just somenamespace, will it only include DLL_1 in the solution and if I use somenamespace.somesubnamespace will it include DLL_1 and DLL_2 in the solution?
Or are DLL_1 and DLL_2 set on the project that contains the namespace and no matter which I use, both DLLs will be copied?
Your code above is exactly equivalent to:
If you write it your way, or if you write it this way, accessing
somesubnamespaceis done exactly the same way in your code.Namespaces are essentially just labels to organize your code. Depending on what your code is accessing will dictate what references you need – but the answer to your question is “no”, the references for
namespacewill not necessarily be required.namespace.somesubnamespaceis an independent namespace in that regard.