Normally it doesn’t make sense to do it this way.
That said, could a c# console app also act as a class library?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it can. As long as it has public types or
[assembly:InternalsVisibleTo(...)].In VS2005 the IDE was reluctant to allow you to reference an exe, but this is no longer the case. Just add a reference and specify the exe (or the project).
Ultimately, it is just an assembly; the PE header / loader is minimal and is not of significant note to the file, hence the fact of it being an exe is virtually irrelevant.
Note that
Main()(the entry-point) won’t be invoked when using an exe as a library.