Re: Interesting file managment feature of VS2005
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 14:37:48 -0500
Kevin,
I think that the general idea is that you would want something
side-by-side, which is why they don't just link to the files. It's just the
mindset of the app. Of course, as you have found out, the option is
available to you.
However, you have to remember that if add the same file across your
projects, then those types in that file compiled into each project will not
be the same types in the compiled assembly, and can not be interchanged or
used amongst those assemblies. If this is ok for your project, then that's
fine, but you need to be aware of it.
The thinking behind the questions as to why you would want to do that is
because the typical way to do this would be to have one project where this
file resides, and then reference that assembly from the other projects you
want to use those types in. It is seen as much easier to manage in the face
of changes (which probably leads to the thinking in VS.NET that you would
copy the file to your local project folder).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
P.S. If you asked me, I would have been able to tell you about the "Add as
Link" option =)
"Kevin Frevert" <kevin@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:u3uTh$E9FHA.3492@xxxxxxxxxxxxxxxxxxxxxxx
> In the process of learning VS2005/C# (having a background in Borland
> Delphi 2 through 2005) I came across an interesting feature of Visual
> Studio's file management. At first, it appeared there wasn't a way for me
> to 'share' common business objects (ex.
> \Projects\Objects\Customer\CustomerObject.cs) across multiple solutions.
> When I select Add -> Existing Item, navigate to the directory, and select
> the .CS file and select Add, VS *copies* the file to the solution's
> directory (no longer follows the local directory structure or structure
> configured in source control).
> What happens when, not if, I change the file? Is this a bug? Have I just
> become lazy because Delphi's default behavior to adding objects/units is
> to *use* the file from where ever you added it from? How can I guarantee
> that all our other developers compile the same base source code?
>
> Then a developer on a Borland newsgroup pointed out the Add button in the
> 'Add Existing Item' dialog box is also a drop-down (yes, very intuitive)
> that allows me to 'Add as Link'. Tada, now my business objects are
> shared, and not copied.
>
> I brought up my dilemma with 3 Microsoft Visual Studio 'experts' at
> PDC-2005 who basically told me sharing files in multiple projects wasn't
> possible (one actually questioned why anyone would do that).
>
> So my question, why would 'linking' not be the default behavior? Wouldn't
> copying lead to more bugs (especially in a multiple developer environment)
> and more file management/versioning headaches? Is there a way to make
> 'linking' the default 'Add' behavior?
>
> Thanks,
> Kevin
>
>
>
.
- Follow-Ups:
- Re: Interesting file managment feature of VS2005
- From: Kevin Frevert
- Re: Interesting file managment feature of VS2005
- References:
- Interesting file managment feature of VS2005
- From: Kevin Frevert
- Interesting file managment feature of VS2005
- Prev by Date: Re: How can I check if a type is nullable with reflection?
- Next by Date: FAQ: VS 2003 and 2005 running together
- Previous by thread: Interesting file managment feature of VS2005
- Next by thread: Re: Interesting file managment feature of VS2005
- Index(es):
Relevant Pages
|