Hi
I have a solution called Tools that has three projects in it; Tools, PerecentageBar, MessageBox. Each of these projects is part of the Tools assembly.[In the properties page of each I have set the AssemblyName to MyCompany.Tools.Controls].
I have in Tools Project:
namespace MyCompany.Tools.Controls
{
public class MyPictureBox : PictureBox
{}
}
And in the MessageBox project.
namespace MyCompany.Tools.Controls
{
public class MyMessageBox : Form
{}
}
And in the PercentageBar project
namespace MyCompany.Tools.Controls
{
public class PercentageBar: UserControl
{}
}
This solution is built and a MyCompany.Tools.Controls.dll created.
In another solution, I have a project called MapperTool.
namespace MapperTool
{
public class MapperToolFacade : IDisposable, IDiagService
{}
}
In this project I add a reference to the dll above AND add a using statement thus:
using MyCompany.Tools.Controls;
All good so far, however. In this project I can only 'see' and use MyPictureBox with the above using statement. The other types MyMessageBox and PercentageBar are not available.
Why is this?
EDIT: Investigation shows that the other types are there and under the namespace MyCompany.Tools.Controls. However, looking in class view they are not listed in the MyCompany.Tools.Controls assembly. Instead they are organised thus:
MyCompany.Tools.Controls (assembly)
MyCompany.Tools.Controls (namespace)
MyPictureBox (type)
PercentageBar
MyCompany.Tools.Controls
PercentageBar
MyMessageBox
MyCompany.Tools.Controls
MyMessageBox
So I guess the next question is, if I have specified the assembly name as MyCompany.Tools.Controls in each project why have the second two projects been built as an assembly with a different name? [ The dll in the output directory does however have the naem MyCompany.Tools.Controls.dll]
Also, I want to creat all my controls in the MyCompany.Tools.Controls namespace and build them into a single MyCompany.Tools.Controls assembly such that I can add just this reference to any other project that needs to use them.
It would appear from what is happening above that each seperate tools project in my MyCompany.Tools.Controls solution would have to be built into a unique assembly and that each would have to be referenced individually...?
The problem was my understanding of projects and assemblies. It would appear that it is not possible to have the 3 projects build into one assembly. Each must build it's own assembly - I will then have to use a merge tool to combine them into one assembly.