Tag Archives: MSBuild

How to use symlinks with MSBuild

via How to use symlinks with MSBuild — By Daniel Cazzulino.

I needed to conditionally re-create symlinks to a known location in the machine from the output of an C# project file (MSBuild custom tasks and targets, that should go to $(MSBuildExtensionsPath)\[Company]\[Product]).

Of course, copying over and over the files wasn’t a very good solution in the long run, and would also force me to always open VS elevated, which is something I’m not fond of.

The obvious solution: create symlinks from the elevation-required location pointing to the project output directory, so that once the symlinks are created (by building from an elevated process), I’d no longer need to run elevated, as long as the file count and location remained the same.