I've got a Solution with lots of projects and all but one of them are behaving. The one that is not working is a console application, and it relies on the C# Class Library project. I've added a reference to the library project and added the namespace (which I've checked is correct), but everywhere I reference the classes in my library, I get:
The type or namespace 'MyClass' could not be found (are you missing a directive or an assembly reference?).
The library project is building successfully (I can see the DLLs appear in the bin folder) and I've tried a project reference, and also a reference to the DLL itself. Neither works.
Also, all projects are set to build with a platform target of 'Any CPU'.
I've tried pretty much every suggestion I've come across on forums with no success. Can anyone shed some light on what's going wrong?
Thanks
This solved the problem:
The console application had a Target framework of .NET Framework 4 Client Profile
, whereas the library just had .NET Framework 4
. I set the console app to .NET Framework 4
and it all builds perfectly.
My bet is on a framework mismatch between your library and you app... Check if your library is not building with a superior version than you app, or if your app is building with a Client profile flavor