I am having a file in my project. This file is used by some other projects. I want to show some messages in this file using console for console projects, and Messagebox for Windows Application projects. So, I want to know the project type programatically.Can anybody say how to achieve this?
Note: The file is in C# language.
EDIT: David's answer is the way I have to follow. But, currently we are near to release date. So, I need to use the project type as temporary solution. Is there any way for that?