473,506 Members | 9,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enums across multiple projects

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?
Nov 16 '05 #1
2 3485
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.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu || http://www.deutronium.tk
"Rathtap" <am****@yahoo.com> schrieb im Newsbeitrag
news:b2**************************@posting.google.c om...
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?

Nov 16 '05 #2
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Rathtap" <am****@yahoo.com> wrote in message
news:b2**************************@posting.google.c om...
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?

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
9511
by: SpaceCowboy | last post by:
I recently got into a discussion with a co-worker about using enums across a dll interface. He wanted to use chars instead, argueing that depending on compiler settings the size of an enum could...
5
13496
by: Tinius | last post by:
I have created a class which I wish to reuse amongst several projects. But each time I Add the class to a new project, it creates a copy of that class in the folder of the new project. This means...
5
8446
by: geoffblanduk_nospam | last post by:
Is it valid to share namespaces across projects in C#? For example, I have a project that contains the code for a core assembly, this builds a DLL. I then have a second project in the same...
2
5669
by: TaeHo Yoo | last post by:
Hi all, I have a solution which contains multiple projects. Those multiple projects should share the same session. For example, users login, create the session for users then these session...
4
5563
by: Martin Pritchard | last post by:
Hi, I'm working on a project that historically contains around 40 enums. In the database various fields refer to the int values of these enums, but of course ref integrity is not enofrced and...
2
1641
by: Brian Henry | last post by:
Is it possible to create web users controls which can actively be used on multiple projects? similarly to how a winforms user control can be used in multiple project when referenced. What I want...
2
2765
by: Brian Henry | last post by:
is there any way to make an assembly file accessable across multiple projects (we have over 20 that need the info all to be the same at build version, title, desc, copyright,etc) i saw MS did this...
1
1988
by: sonali_reddy123 | last post by:
Hi all, I have developed an application in which there are uptill now 12 projects and few of them are dependent on each other. The problem is I am not able to manage the references across...
2
1959
by: Jeff Dege | last post by:
I'm working with a group that's been doing C++ coding for quite a long time, now, and in that environment we've pretty much worked out development practices that serve us well. We've been doing...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7479
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.