-
March 22nd, 2013, 01:30 PM
#1
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.
-
March 22nd, 2013, 06:22 PM
#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?
-
March 22nd, 2013, 06:23 PM
#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/
-
March 26th, 2013, 01:45 PM
#4
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
-
March 28th, 2013, 01:41 PM
#5
Re: Source directories in C# IDE VS2010
Originally Posted by Dave C
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).
Originally Posted by Dave C
Edit: It seems that C++ projects maintain links to external files and C# projects don't.
Not true. C# has this ability as well.
Originally Posted by Dave C
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?
-
March 28th, 2013, 01:55 PM
#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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|