How can I run custom script which will upload ClickOnce deployment files to a web-server (in my case Windows Azure Blog Storage) right after publishing? Is it possible to modify MSBuild file in some way so it would run custom script right after ClickOnce published files into a local folder?
Asked
Active
Viewed 1,588 times
1 Answers
2
Yes, you can hook to build process using various technics:
- pre and post build actions ( from visual studio project properties menu). It's actually exec task hooked into your project file
- you can override your DependsOn property for concrete target and append execution of your own target (pre-Msbuild 4.0 way)
- you can declare your target and hook with AfterTarget\BeforeTarget attributes (Msbuild4.0 way).
As for uploading something to blob - you can use Exec task in your own target to upload or use whatever tool\script you usually use to uploading files to website\Blob storage.
NB: You could clarify your question with following points (if you need more concrete answer) :
- what kind of build process you are using - build from VS, CI server with custom msbuild script, CI server that building your sln file etc
- what kind of script\tool you want to execute to upload build result.
- do you know the name of last executed msbuild target, after which you want to fire your tool.

Alexey Shcherbak
- 3,394
- 2
- 27
- 44
-
I just right click on the project > Publish. Dunno where to hook custom events after publishing is completed.. – Grief Coder Oct 02 '12 at 14:53
-
This action actually run concrete msbuild target. You can find this by following msbuild log output which sent to your VS output window. I did point how you can modify msbuild script to add your own custom script and hook it to be fired after publishing. If you already made proper script for uploading - just run it using exec task in your custom target that can be hooked via various ways to run after publishing target. – Alexey Shcherbak Oct 02 '12 at 16:04