0

I've created a C# library (Tempates > Visual C# > Windows > Class Library) called VlcController, with one class Controller.cs, containing one class, started like so,

namespace Vlc
{
    class Controller
    {
       // Rest of code..
    }
}

When I build it t o a .dll, and include in in a seperate project, it has no issue with using Vlc;, but it cannot find the Controller class. Is there something I need to do to get my class included in the .dll?

If needed I can upload the .dll too, just ask.

TMH
  • 6,096
  • 7
  • 51
  • 88
  • 2
    @Alexei indeed, not quite a duplicate as you're missing a step from this question to that one. I think [Can't see class within DLL](http://stackoverflow.com/questions/13271858/cant-see-class-within-dll) answers it properly. The [default access modifiers question](http://stackoverflow.com/questions/2521459/what-are-the-default-access-modifiers-in-c?lq=1) explains the background in more detail. – CodeCaster Feb 24 '16 at 20:55

1 Answers1

1

Your class is internal, that is why you do not find it. The default accessor for a class is internal.

This will help:

namespace Vlc
{
    public class Controller
    {
       // Rest of code..
    }
}
Peter
  • 27,590
  • 8
  • 64
  • 84
  • Well damn, so simple! @AlexeiLevenkov could you expand on that a little please? – TMH Feb 24 '16 at 20:54
  • Unspecified access levels default to `internal`. `internal` means a class is only accessible in the assembly the class in defined. – will Feb 24 '16 at 20:55