473,320 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

VS 2005: how to use the same class.cs in two projects

c# how to use the same class in two projects?

i have solution that consists of website, winapp and web service.

i need to use the same class MyClass.cs in all three applications.

i cannot figure out how to do in the VS 2005?


Mar 10 '06 #1
2 1153
You'd have at least two choices. You can (a) compile the contents of the
MyClass.cs file into a Class Library project and then consume the assembly
from the other projects, or (b) when you add the file to a project you
should be able to select the "link file" option from the dropdown on the
"open" button - this would allow you to share (link) the file between other
projects.

--
Tim Wilson
..NET Compact Framework MVP

"Serdge Kooleman" <Su***@web.de> wrote in message
news:Oo**************@TK2MSFTNGP11.phx.gbl...
c# how to use the same class in two projects?

i have solution that consists of website, winapp and web service.

i need to use the same class MyClass.cs in all three applications.

i cannot figure out how to do in the VS 2005?

Mar 10 '06 #2
"Serdge Kooleman" <Su***@web.de> wrote in message
i have solution that consists of website, winapp and web service.

i need to use the same class MyClass.cs in all three applications.

i cannot figure out how to do in the VS 2005?

Add a 4th project "BusinessStuff" to the solution. Put "Myclass.cs" into
that project.

Add a proiject reference from website, winapp, and webservice to the
BusinessStuff project.

Now, in any of those, just say, "BusinessStuff.MyClass mc;" and you're good
to go.

--
Chris Mullins
Mar 10 '06 #3

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

Similar topics

54
by: m.roello | last post by:
In the book: "Working with Microsoft Visual Studio 2005" Craig Skibo wrote: "The power of Visual Studio 2005 lies in its ability to empower users to build, test, and debug powerful applications...
1
by: Willy S | last post by:
Where has the /bin directory with the *.dll file(s) gone in asp.net projects in vs 2005? I cant find any /bin directory in the projects - so how can I ftp a new web/web-service to prod. server...
2
by: Richard Collette | last post by:
Hi, I have a service, that runs perfectly when executed outside of the web service environment. When called as a web service I get the exception listed below sporadically. A call to the web...
3
by: Nick Gilbert | last post by:
Hi, In my VS.NET 2005, if I choose Build Clean Solution, the BIN folder is not touched. Shouldn't it delete all the dll and pdb files in that folder first? Instead, I'm finding I have to do it...
3
by: Med | last post by:
Hi, I use Visual C# Express 2005 and Visual Web Developer Express 2005. In my Visual C# Express 2005 Solution, I have following two class library projects: _ DataAccess (Namespace name:...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.