Enums across multiple projects

R

Rathtap

Suppose I have the following enum that I need in multiple projects:

enum Ratings{Poor=1,Satisfactory,Medium,Good,Excellent};

Instead of defining it in every project that needs it, I want to
create it in one and have it accessible from the others. How do I do
it?
 
C

cody

You have to compile the project which contains the definition of your enum
as dll.
Then you can add in the other projects a reference to this dll, and now you
can use this enum is this projects.
 
N

Nicholas Paldino [.NET/C# MVP]

Rathtap,

All you have to do is define it in an assembly, and reference that
assembly among all those projects that you want to use it in.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

about enum 3
enum questions 2
Enum extenting 3
enum defined in a linked .cs file 8
Options for replacing enums stored in database.... 4
Design Q 2
I have small probalem 4
enum string value 3

Top