Home All Groups Group Topic Archive Search About

Shared .cs files, and file locations

Author
25 Mar 2005 3:45 PM
Dan Baker
I'm relatively new to the .cs world.  I would like to have some "shared" .cs
files, which several solutions can use.  I don't want to place these in a
..dll, I simply want them included into various applications.  I have tried
several methods, but most have failed. The most obvious way (I thought) was
to place the .cs files in a parent folder (maybe called "shared"), and then
simply drag-n-drop the files into the "Solution Explorer" (files list) -- 
But, this actually copies the files into the folder where the solution
exists.

Is there some way to have a folder with many .cs files in it, and have those
..cs files be included in several solutions?

Any suggestions, pointers concepts, ideas?
Thanks
DanB


The only idea I currently have is as follows:
1) Have a main project folder: "C:\Projects\"
2) Place the solution files for every project in this folder (this includes:
..sln, .slu, .csproj, .csproj.user)
    (Note: This seems like a huge pain. Every project solution files are in
the same folder! Yuck!)
    project1.*
    project2.*
    project3.*
    ...
3) Each project would have a folder for the project files:
"C:\Projects\project1"
    Form1.cs
    App.ico
    bin\
    ...
4) Have a "shared" folder:  "C:\Projects\Shared"
    Shared.cs
    OtherShared.cs
    ...
5) Now, all the projects can include the shared .cs files, and only have
*one* copy of them also.

Author
25 Mar 2005 3:54 PM
Tim Wilson
There was a discussion on this subject a little while back.
http://www.google.ca/groups?hl=en&lr=&threadm=ezSxhvsHFHA.3208%40TK2MSFTNGP10.phx.gbl&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26selm%3DezSxhvsHFHA.3208%2540TK2MSFTNGP10.phx.gbl

--
Tim Wilson
..Net Compact Framework MVP

Show quote
"Dan Baker" <dbmail> wrote in message
news:uoJUcGVMFHA.2468@tk2msftngp13.phx.gbl...
> I'm relatively new to the .cs world.  I would like to have some "shared"
..cs
> files, which several solutions can use.  I don't want to place these in a
> .dll, I simply want them included into various applications.  I have tried
> several methods, but most have failed. The most obvious way (I thought)
was
> to place the .cs files in a parent folder (maybe called "shared"), and
then
> simply drag-n-drop the files into the "Solution Explorer" (files list) --
> But, this actually copies the files into the folder where the solution
> exists.
>
> Is there some way to have a folder with many .cs files in it, and have
those
> .cs files be included in several solutions?
>
> Any suggestions, pointers concepts, ideas?
> Thanks
> DanB
>
>
> The only idea I currently have is as follows:
> 1) Have a main project folder: "C:\Projects\"
> 2) Place the solution files for every project in this folder (this
includes:
> .sln, .slu, .csproj, .csproj.user)
>     (Note: This seems like a huge pain. Every project solution files are
in
> the same folder! Yuck!)
>     project1.*
>     project2.*
>     project3.*
>     ...
> 3) Each project would have a folder for the project files:
> "C:\Projects\project1"
>     Form1.cs
>     App.ico
>     bin\
>     ...
> 4) Have a "shared" folder:  "C:\Projects\Shared"
>     Shared.cs
>     OtherShared.cs
>     ...
> 5) Now, all the projects can include the shared .cs files, and only have
> *one* copy of them also.
>
>
Author
25 Mar 2005 4:11 PM
Dan Baker
Fantastic!
Thank you * 1Gig.
DanB

The part from the discussion I was looking for I copied below:
"When you add the code file to the project make sure that you specify it as
a
"link file". So in the "Add Existing Item" dialog, after you select the
DM.cs file, select the drop down arrow on the "Open" button and then select
"Link File". The file will now appear in the Solution Explorer, under the
appropriate project, with a code file icon that looks like it has a little
shortcut image over top of it."

Show quote
"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
news:eV73ULVMFHA.1308@TK2MSFTNGP15.phx.gbl...
> There was a discussion on this subject a little while back.
> http://www.google.ca/groups?hl=en&lr=&threadm=ezSxhvsHFHA.3208%40TK2MSFTNGP10.phx.gbl&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26selm%3DezSxhvsHFHA.3208%2540TK2MSFTNGP10.phx.gbl
>
> --
> Tim Wilson
> .Net Compact Framework MVP
>
> "Dan Baker" <dbmail> wrote in message
> news:uoJUcGVMFHA.2468@tk2msftngp13.phx.gbl...
>> I'm relatively new to the .cs world.  I would like to have some "shared"
> .cs
>> files, which several solutions can use.  I don't want to place these in a
>> .dll, I simply want them included into various applications.  I have
>> tried
>> several methods, but most have failed. The most obvious way (I thought)
> was
>> to place the .cs files in a parent folder (maybe called "shared"), and
> then
>> simply drag-n-drop the files into the "Solution Explorer" (files list) --
>> But, this actually copies the files into the folder where the solution
>> exists.
>>
>> Is there some way to have a folder with many .cs files in it, and have
> those
>> .cs files be included in several solutions?
>>
>> Any suggestions, pointers concepts, ideas?
>> Thanks
>> DanB
>>
>>
>> The only idea I currently have is as follows:
>> 1) Have a main project folder: "C:\Projects\"
>> 2) Place the solution files for every project in this folder (this
> includes:
>> .sln, .slu, .csproj, .csproj.user)
>>     (Note: This seems like a huge pain. Every project solution files are
> in
>> the same folder! Yuck!)
>>     project1.*
>>     project2.*
>>     project3.*
>>     ...
>> 3) Each project would have a folder for the project files:
>> "C:\Projects\project1"
>>     Form1.cs
>>     App.ico
>>     bin\
>>     ...
>> 4) Have a "shared" folder:  "C:\Projects\Shared"
>>     Shared.cs
>>     OtherShared.cs
>>     ...
>> 5) Now, all the projects can include the shared .cs files, and only have
>> *one* copy of them also.
>>
>>
>
>

AddThis Social Bookmark Button