Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to make user specific pre/post build events in Visual Studio projects?

I'm currently using a post build event in my project to copy my assemblies to another directory for debugging purposes. This is local to my machine, and is for debugging purposes only, so I would prefer to have it in a *.csproj.user file instead of a *.csproj file. I tried copying the responsible elements from the *.csproj to the *.csproj.user, but that didn't work.

Edit To clarify, I do not want to put user specific commands in the post-build event in the *.csproj file. Instead, I want to put the post-build event commands in the *.csproj.user file. (From the answers so far, this is looking impossible)

To give more context, it is not a project reference. I am copying my assembly to the directory of the application that loads the assemblies at runtime. (Think plugins)

like image 589
blachniet Avatar asked Jul 27 '12 15:07

blachniet


1 Answers

The short answer is no, not the way you want to do it :|

The slightly longer answer is sorta. You can in theory have specific build events triggered for individual users, but these would still be in the csproj file. You can run external events on builds and then allow these external events to run depending on what user is running them (as a script).

If this is for debug only I'd just insert them, do your build stuff and pull them out before uploading it to your version control system.

like image 110
John Mitchell Avatar answered Nov 15 '22 21:11

John Mitchell