locked
Same File, different Projects RRS feed

  • Question

  • Hi!

    Is there any possibility to add the same file (not a copy) into different projects?

    thx
    Tuesday, October 7, 2008 8:42 AM

Answers

  • Yes. When you go to add an existing file to a project via "Project | Add Existing Item", if you look closely at the "Add" button you'll see a little drop-arrow on it. If you click that, you get the option to add the file as a link. That's what you want to do.
    • Proposed as answer by Matthew Watson Tuesday, October 7, 2008 9:24 AM
    • Marked as answer by DSchiefer Tuesday, October 7, 2008 10:37 AM
    Tuesday, October 7, 2008 9:23 AM

All replies

  • Yes. When you go to add an existing file to a project via "Project | Add Existing Item", if you look closely at the "Add" button you'll see a little drop-arrow on it. If you click that, you get the option to add the file as a link. That's what you want to do.
    • Proposed as answer by Matthew Watson Tuesday, October 7, 2008 9:24 AM
    • Marked as answer by DSchiefer Tuesday, October 7, 2008 10:37 AM
    Tuesday, October 7, 2008 9:23 AM
  • Be careful adding the same file to multiple projects, especially within the same solution.  This will cause you pain and frustration.  When you add the same class file to two projects, you will get "two versions" of that class (one for each assembly), and they will be incompatible with each other.  Make sure if you do this, your two assemblies you're creating never "run in the same circles" as each other.
    David Morton - http://blog.davemorton.net/
    Tuesday, October 7, 2008 3:38 PM