I've created a dll
, lets call it ExampleHelper.dll
.
The structure of the Visual Studio Class Library which I've compiled to dll
is the following:
namespace ExampleHelper
{
public class Example
{
public string GetExamples(string input)
{
// stuff
}
}
}
So, I reference it in my other project in which I want to use these ExampleHelper
classes, by adding a using
line at the top of the file in question:
using ExampleHelper;
Now, I can see that I can access the class from ExampleHelper
, which is called Example
. But, I can't access the methods in that class, which means I can't write Example.GetExamples("hello")
, as it says GetExamples
doesn't exist.
I noticed that I can do this:
Example e = new Example();
e.GetExamples("hello");
which I of course can use, but it doesn't feel quite right to instantiate a new object each time I want to use a helper method.
Have I done something completely wrong? My guess is yes, but I can't find where I'm going wrong. Any help appreciated!