I've got a Solution with lots of projects and all but one of them is behaving. The one that is not working is a ConsoleApplication, and it relies on C# Class Library project. I've added a reference to the library project, and add 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 using 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.
question from:
https://stackoverflow.com/questions/9790104/project-reference-not-working-in-visualstudio2010 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…