none
add file in multiple projects without duplication RRS feed

  • Question

  • I have two projects within a VS 2017 solution and want to compile some files from one project in the other.  I used Add Existing Item to add the files to the second project and it duplicated them on disk.  Is there a way to do this so both projects reference the same copy of the file?  The reason this is important is that the files are generated by external utilities and it will be a pain to copy them or allow them to get out of sync.  Thanks for any pointers.
    Monday, August 19, 2019 9:52 PM

Answers

  • Hi,

    You can add the files as a link. Press the arrow down button right of the open button.

    Best Regards,

    Heiko

    • Marked as answer by John Boncek Tuesday, August 20, 2019 1:23 PM
    Monday, August 19, 2019 10:15 PM
  • Hi John,

    Welcome to the MSDN forum.

    You can try to add the file as a link to the project as Heiko said. 

    Please follow these steps:

     choose add existing item-->select the file and remember to change the add to add as link.

    More information you can refer to this:

    https://grantwinney.com/visual-studio-add-file-as-link/

    Note: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you. 

    Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet

    Hope it could help you.

    Best Regards,

    Perry




    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by John Boncek Tuesday, August 20, 2019 1:23 PM
    Tuesday, August 20, 2019 9:38 AM

All replies

  • Hi,

    You can add the files as a link. Press the arrow down button right of the open button.

    Best Regards,

    Heiko

    • Marked as answer by John Boncek Tuesday, August 20, 2019 1:23 PM
    Monday, August 19, 2019 10:15 PM
  • Hi  John,

    Thank you for posting here.

    Since this thread is related to Visual studio, I will move it to Visual Studio General Questions forum.

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best Regards,

    Jack



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 20, 2019 2:19 AM
  • Hi John,

    Welcome to the MSDN forum.

    You can try to add the file as a link to the project as Heiko said. 

    Please follow these steps:

     choose add existing item-->select the file and remember to change the add to add as link.

    More information you can refer to this:

    https://grantwinney.com/visual-studio-add-file-as-link/

    Note: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you. 

    Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.

    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet

    Hope it could help you.

    Best Regards,

    Perry




    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by John Boncek Tuesday, August 20, 2019 1:23 PM
    Tuesday, August 20, 2019 9:38 AM
  • Thank you.  Missed the little drop-down arrow.
    Tuesday, August 20, 2019 1:25 PM