Using Shared Classes

S

Sylvie

Hello,

I have a web application and windows application,

My web application has App_Code folder and in this folder have a Users.cs
file, this file has some user management classes and routines,

The problem is, when I try to use this class from windows application and
want to add these classes to my app. Vs.2005 copies these classes to windows
application folder, it means, it duplicates these users.cs file

I want to use first Users.cs as a reference, How can It be ?

Thanks
 
J

Jon Skeet [C# MVP]

I have a web application and windows application,

My web application has App_Code folder and in this folder have a Users.cs
file, this file has some user management classes and routines,

The problem is, when I try to use this class from windows application and
want to add these classes to my app. Vs.2005 copies these classes to windows
application folder, it means, it duplicates these users.cs file

I want to use first Users.cs as a reference, How can It be ?

Create a class library containing the common code, and reference it
from both projects.

Jon
 
R

Rene

If you are using a source control program, you may be able to share the
files between the two projects. I think in Visual Source Safe this is called
"Share file".
 
J

Jon Skeet [C# MVP]

If you are using a source control program, you may be able to share the
files between the two projects. I think in Visual Source Safe this is called
"Share file".

That's a really bad solution to the problem though - using a class
library is a solution specifically designed for this very problem.

Jon
 
J

Jon Skeet [C# MVP]

T.J. Thornbrook said:
Then you have the dll in two places.

You have the "original" DLL in one place, and then building the other
applications copies the DLL. There's no harm in that, IMO.
 
S

Sylvie

I ll try Class Library

Thanks


iletide sunu yazdi said:
You have the "original" DLL in one place, and then building the other
applications copies the DLL. There's no harm in that, IMO.
 

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

Top