VS.NET: Adding one .cs file to more then one project 
Author Message
 VS.NET: Adding one .cs file to more then one project

Hi,

I think this is not the correct newsgroup for my question, please direct me
to the correct one.

How can I add one .cs file to more then one project? When I add a file in
another directory to my project, VS.NET copies the file to my project
directory. This is absolutely not what I want, I don't want to separate
copies of my code. I want one copy of the code, whenever I change it, both
projects are using the same code. Sure, I code create a separate DLL
project, but it's only one file.

TIA
Markus



Sat, 02 Oct 2004 22:27:46 GMT  
 VS.NET: Adding one .cs file to more then one project
Use Visual Source Safe and add the file to one source safe
project, then Share the file to a 2nd project.  You will
have two copies of the same file, but in VSS it is viewed
as one file, and if you check it out for editing in one
location, you then "Get" the file in the other location to
keep it current.  Its somewhat manual, but its the best
option there is right now for keeping code synched.

Question:  If you want the same functionality in two
different apps, why not build the CS file as a shared
assembly then reference it from your two separate apps
instead of creating redundant code?

Quote:
>-----Original Message-----
>Hi,

>I think this is not the correct newsgroup for my

question, please direct me
Quote:
>to the correct one.

>How can I add one .cs file to more then one project? When
I add a file in
>another directory to my project, VS.NET copies the file
to my project
>directory. This is absolutely not what I want, I don't
want to separate
>copies of my code. I want one copy of the code, whenever
I change it, both
>projects are using the same code. Sure, I code create a
separate DLL
>project, but it's only one file.

>TIA
>Markus

>.



Sat, 02 Oct 2004 22:47:12 GMT  
 VS.NET: Adding one .cs file to more then one project

=== How to Link  an existing file ===
Right Click on Project name within Solution Explorer
Select Add -> Add Existing Item
In the Add Existing Item dialog box select the required file
Then instead of clicking on Open button, click on **down arrow button** next to open
click on **Link File...** option

Thanks,
Indira Dhingra
Microsoft Support

~~This posting is provided "AS IS" with no warranties, and confers no rights.~~



Sat, 02 Oct 2004 23:44:29 GMT  
 VS.NET: Adding one .cs file to more then one project

Quote:

> === How to Link  an existing file ===
> Right Click on Project name within Solution Explorer
> Select Add -> Add Existing Item
> In the Add Existing Item dialog box select the required file
> Then instead of clicking on Open button, click on **down arrow button**
next to open
> click on **Link File...** option

> Thanks,
> Indira Dhingra
> Microsoft Support

Aargh, I really missed it. Thank you so much, now that I know this it seems
so obvious...

Markus



Sun, 03 Oct 2004 00:42:33 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Adding cs-files from another directory in VS.NET

2. Create one singleton object in other interface's method (in one project)

3. How to add one to one relationship in access97 database thru SQL

4. Can't add more than one ATL object to an ATL project using wizard

5. how to share the codes in two projects of one solution in visual studio .net

6. .NET Project References (easy one)

7. My one complaint with VS.NET and C#

8. Creating separate text files from one large one

9. read hexadecimalvalues one by one out from a file

10. newbie: more than one file in my project

11. More than one C-File in a Project

12. How can I delete one subproject in the main project file in VC 4.1

 

 
Powered by phpBB® Forum Software