Click here to Skip to main content
15,942,847 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Dear friends,

I am planning to use interfaces in my .net project.

I would like to add a new project "MyInterfaces" in my existing solution. "MyInterfaces" intends to contain all the necessary interfaces of the solution.
But i am somewhat confused about the project type. What type of project should i choose to start "MyInterfaces"? Class Library, or something else?

Then, what type of item would i add into that project to declare an interface? Interface or class?

Please obliged my by providing a tiny help.


If your code contains not user interface elements (and Interfaces generally don't), then Class Library is the one to go for.

If you want an Interface, use that! It provides a better template than Class - but there isn't a lot of difference!
Share this answer
Sergey Alexandrovich Kryukov 15-Aug-11 0:16am    
Griff, you cannot say anything certain about what is "usually" done. Interfaces are absolutely universal, could be used anywhere. One developer would use more interfaces in graphical UI-enabled applications more than some other on the class libraries -- it all depends.
Please see my solution.
Incorrect question. Interfaces can be used in any projects and most typically should be. This is almost the same thing as one would ask "in what type of project should I use operator =".

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900