12

Where I work, we've gone to great lengths to create a build script in Fake that does a whole host of things, so that developers can check what's going to happen on the TeamCity server before committing. It's great when run from the command line, but I'd really like the ability to have that script called when doing a build from within Visual Studio.

From my own research, I've not found anything that currently allows this, nor have I found any VSIX that does what I want. I'm currently running on the assumption that if I want to proceed with this thinking, that I will need to write a VS Extension myself.

Does anyone here know of any existing VSIX, or any way to change the default behaviour of build?

For reference, target VS is 2015.

pms1969
  • 3,354
  • 1
  • 25
  • 34
  • You can override the Build target in a project file and it will do whatever you put in there, like calling your Fake build script. From the info you give that sounds much easier than fiddling with extensions and trying to get them on all developpers' machines etc – stijn Dec 03 '15 at 20:12
  • given that the fake script calls msbuild, wouldn't that put me in a recursive loop to failure? – pms1969 Dec 04 '15 at 09:28
  • not if it calls msbuild on another project, of if on the same project it would call e.g 'msbuild myproject /target:ActualBuild' where ActualBuild is the target which does the actual build – stijn Dec 04 '15 at 10:08
  • Ahh, clever. Just not something that I want to implement across 130 solutions and 500+ projects. I'd rather attack 20 developer machines. ;-) – pms1969 Dec 04 '15 at 11:21
  • @stijn if I understand your solution correctly then it would not work on VS2013 as described in [this SO thread](http://stackoverflow.com/questions/28706387). However, VS2015 should be fine (not tested myself) as can be seen in [here](https://connect.microsoft.com/VisualStudio/feedback/details/1169409). **EDIT:** talking about the case when building the same project recursively but for different target. – Michal Hosala Dec 14 '15 at 15:27

1 Answers1

0

If it's just parameters you're trying to pass eg.

code.exe -b 

Then you can change the build settings in the solution under properties>debug.

Zanidd
  • 133
  • 13
  • Thanks Zanidd, but I'm meaning VS-any-flavour-except-Code. :-( But I do like Code – pms1969 Apr 19 '16 at 13:33
  • Oh code.exe was supposed to be a placeholder. If you wanna start your apps with params like anyexe.exe -p -t you can type those params in the properties debug windows – Zanidd Apr 19 '16 at 13:46