1

Is there a built in way of executing an MSBuild target on the remote server using MSDeploy?

If I include a targets file in my project so that it is deployed is there a built in way or executing msbuild.exe? I know I could use runCommand but then the path to msbuild.exe could be wrong.

Isantipov
  • 19,491
  • 2
  • 26
  • 41
Greg B
  • 14,597
  • 18
  • 87
  • 141

2 Answers2

1

Referring to the answer on

Exec Task in MSBuild for execution of command on remote machine

MSBuild has no built in support for remote machine installation and only executes commands you tell it too and carries on from there. In our place we have service installed on the remote machine which keeps monitoring our release folder. As soon as a new item (A zipped item containing all the files) becomes available it will perform our release operation. This might be similar in your scenario too.

Community
  • 1
  • 1
MHOOS
  • 5,146
  • 11
  • 39
  • 74
1

I've never heard of a built-in way to execute MsBuild from webdeploy. I don't even think it's necessarily a valid idea to have such a built-in way as target machine can have several versions of msbuild co-existing (v2.0\3.5\4.5\etc) - how do you tell msDeploy which to use?

I suggest, that you use runCommand and refer to msBuild using system variables: %WinDir%\Microsoft.Net\Framework\v4.0.30319\

Keeping in mind that framework versions move rather slowly you're safe (as you generally know, which version of the framework you target)

UPD: if you want a better way to find msbuild location - check out this answer (read from registry)

Community
  • 1
  • 1
Isantipov
  • 19,491
  • 2
  • 26
  • 41
  • I think you're right. I think you know enough about the target machine that you know what frameworks are installed. – Greg B Jun 19 '14 at 08:16