Linked files in Visual Studio projects

Following my post "Visual Studio and PowerShell Trick" I had another little issue, I have one mapping file, mapping.xml, that I want to use on my website and with my data access layer unit tests project.

I used to solve this using the linked file possibility of Visual Studio. Point the target folder, and click Add Existing item, browse to your source folder, choose the original file, and at the bottom of the dialog you will have the Add button showing a dropdown, you juste then need to use Add As Link.

Now I have the same mapping file used in both locations.


 

 

And I can run and watch the results of my unit tests happily!

3 Comments

  • Yeah i was going to blog that! :P cool yeah link files are really usefull, you can share assembly infos so all your dll have the same company name, custom attributes, same other stuff, and the best thing is that vss, tfs, cvn and vcn all keep it track of it correctly so if you are using exclusive check outs only one dev can have it out at the time. pretty good.

    ---------
    http://undocnet.blogspot.com

  • Serious CI problems. When the underlying file is updated in the source project, your 'linked' project's code trunk does not get updated on the check-in.

    Also, linked files are relative to the physical structure of your mapped files to source control. This will jack you when you go to a QA/Prod environment if you already have well established project branches.

    Warning!

  • toddpi314: You address this kind of issues setting 'Copy if newer'

Comments have been disabled for this content.