Console application keeps losing it's connection to class library
I have tried this with an existing console application and a brand new console application. I include the class library project in the console a开发者_运维百科pplication. It works fine until I build it, then I get an error asking if I'm missing a reference. This is my first console application, is there something I don't know about console applications and class libraries?
Set the console application to Startup Project so when you hit the F5, your console application will be executed.
I had exactly the same problem. At the point when I try to build the console app the build fails because it no longer has the reference; so all classes inside the reference are unknown to it.
To fix the problem, I changed the project to target ".NET Framework 4" rather than ".NET Framework 4 Client Profile".
Have you tried adding class library namespace to console application?
using <library class namespace name>;
It worked for me!
精彩评论