Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations
Another minor C#/C++ difference - adding existing files

Another minor detail that bit me for a few minutes today. I'm posting this so I'll see it and remember, and possibly lodge it in other people's consciousness.

Using Visual Studio 2005, adding an existing .cs file to a C# project will cause a copy of that file to be created in the project directory. If I want to link to the original file, I need to explicitly choose Add As Link from the dropdown on the Add button.

C++ projects, however, have the opposite behavior. Adding an existing item in a different folder will add a link to the original file in the original location. To create a copy, manually copy it to the project dir.

That is all.

Published Sunday, October 28, 2007 5:35 PM by Avner Kashtan

Filed under: , ,

Comments

# re: Another minor C#/C++ difference - adding existing files@ Thursday, June 12, 2008 2:06 PM

Thanks this kept me from hunting through VS!!!

Joel

Leave a Comment

(required) 
(required) 
(optional)
(required)