I have one assembly library that contains a class called “Architecture”. In another assembly i have the class called “ArchitectureManager” that helps me to implement some specific class types of that current assembly.
Finally i have a third assembly project that needs “ArchitectureManager”, the problem comes how to hide “Architecture” from this third assembly project, since the second assembly needs it, also i cant just merge project two into project one.
Here is a snippet for further clarification:
//Assembly one
public class Architecture
{
}
//Assembly two
public class ArchitectureManager
{
//Implement some Architecture class methods
}
//Asembly three needs ArchitectureManager but doesnt need to know about Architecture.
You can use the
InternalsVisibleToattribute for your assembly containingArchitecture. You mark it asinternaland allow it to be visible only to your other assembly.See this MSDN link: http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx
You can also see other questions tagged here on SO: https://stackoverflow.com/questions/tagged/internalsvisibleto
Is there a specific reason why your
Architectureobject cannot be visible to other classes though? I rarely do this myself..