CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2001
    Location
    USA
    Posts
    298

    Source directories in C# IDE VS2010

    I have a directory of class files that will be used by multiple projects and solutions. When I add a file from that directory to one of my projects Visual Studio copies it into the project directory. This rather defeats the purpose of having a common repository, since any changes I make don't get reflected back to other projects.

    Is there a reason for this behavior? I've been doing this with C++ files for years and it's worked for me.

  2. #2

    Re: Source directories in C# IDE VS2010

    When you add it as an existing file, it gives you an option to either copy or link it. Do you see one?

  3. #3

    Re: Source directories in C# IDE VS2010

    By default, as I know it links it from the location unless theres a setting otherwise.

    --
    http://savensearch.blogspot.com/

  4. #4
    Join Date
    Jun 2001
    Location
    USA
    Posts
    298

    Re: Source directories in C# IDE VS2010

    I don't understand why this is happening then. Project->Add Existing Item doesn't have any options, and I find nothing in the project properties or tools menus that would affect this.

    Edit: It seems that C++ projects maintain links to external files and C# projects don't.

    http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx

    No apologies there for making us have to update all projects independantly.
    Last edited by Dave C; March 26th, 2013 at 02:01 PM. Reason: Figured it out

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Source directories in C# IDE VS2010

    Quote Originally Posted by Dave C View Post
    I don't understand why this is happening then. Project->Add Existing Item doesn't have any options, and I find nothing in the project properties or tools menus that would affect this..
    Notice the little drop down arrow, next to the Add button in the Add Existing Item dialog? Click this arrow and you get 'Add' and 'Add as Link' menu items. Choose the 'Add as Link' to add a link to files in a common repository without copying the file(s).

    Quote Originally Posted by Dave C View Post
    Edit: It seems that C++ projects maintain links to external files and C# projects don't.
    Not true. C# has this ability as well.
    Quote Originally Posted by Dave C View Post
    No apologies there for making us have to update all projects independently.
    It's my experience that most of the problems blamed on Microsoft are actually a result of user error. What's your experience?

  6. #6

    Re: Source directories in C# IDE VS2010

    Tried to add as link by using Add Existing Item - once you add it, the item shows as a linked file with the icon. See below, have linked clsCommonFunctions.cs from another project folder. When you update it here, that gets updated since its only as well.

    Attachment 31231

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured