I’ve created a DLL and referenced it to my project, but I cannot figure out how to actually use it. It appears that to make it work, I have to use some code like
MyClass class = new MyClass;
But I still can’t get it to work. Here’s my code:
using MyClass;
namespace NoName
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
MyClass MyClass = new MyClass();
Bitmap bmp = new Bitmap(MainImage.Image);
}
}
}
Make sure you have referenced the namespace that holds the types you want to use from your class library in the dependent program.
In most cases the root namespace you are looking for should match the name of your referenced dll. e.g. DLLName.xxx … where “DLLName” would be your root namespace and the anything after the period would signify child folders in a continuing hierarchy.