Re: Interesting file managment feature of VS2005

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
>
>
>


.



Relevant Pages

  • Interesting file managment feature of VS2005
    ... management. ... across multiple solutions. ... Then a developer on a Borland newsgroup pointed out the Add button in the ... Tada, now my business objects are shared, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Debugger Already attached, help
    ... create multiple compies of the same website). ... They can then each debug ... but both apps need to use the same debugger and it ... as they would be continuously doing things that hurt the other developer. ...
    (microsoft.public.dotnet.framework)
  • Re: Debugger Already attached, help
    ... you can quickly see that you can concurrently debug multiple IIS ... if the debugger modules are installed under the framework folder ... How is it MS thinks that only one developer ...
    (microsoft.public.dotnet.framework)
  • Re: C# Plugin system - same interface in two different assemblies...
    ... A developer using a skeleton plugin ... a user typing out the interface ... If you simply put one interface per assembly you're only including in the developers code once but then they have to have all the assemblies which they 'may' use... ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C# Plugin system - same interface in two different assemblies...
    ... Is it simpler for developers to duplicate code or not ... A developer cutting and pasting an interface from your SDK documentation? ... There's a bunch of reasons why using a single assembly for anything shared in commonality between assemblies is a poor idea instead of there being a method of equanimity. ...
    (microsoft.public.dotnet.languages.csharp)