visual studio 2008 - Msbuild question -


i have several long running custom build tasks. looks visual studio, however, runs msbuild tasks on ui thread, causing ide hang.

i did little bit of searching on google, , best find bugs reports response "oh yeah, that's problem, we'll maybe fix later".

http://connect.microsoft.com/visualstudio/feedback/details/670873/visual-studio-ui-freezes-during-long-msbuild-task

http://social.msdn.microsoft.com/forums/en-us/msbuild/thread/3289eb7d-7989-4350-8c43-02bf9913edbd/.

so, decided fix custom tasks by:

  1. detecting when running inside of visual studio.
  2. running tasks on background thread if are
  3. adding "msgwaitformultiplehandles / custom message pump" ui thread keep ui responsive while things run.

this seems work. can run builds without ide freezing.

in case, brought few questions:

  1. is safe do? visual studio massive thing. run re-entrancy problems if this? re-entrancy problems cause world end, or can away ignoring them.

  2. i detect visual studio using technique outlined in this post. basically, assign value of "buildinginsidevisualstudio" property property on task, check in execute() method. if it's true, use multi-threaded behaviour, otherwise use sequential behaviour. this, however, requires each target using task put goo msbuild file avoid suckyness. ideally "not sucking" normal behaviour, without special configuration. there way can detect visual studio inside task's execute() method? can read project property in task implementation without requiring custom edits xml? can interrogate host object somehow?

thanks.

try setting environment variable msbuildnoinprocnode 1 , launch ide. force ide build requests child nodes. make note not tested scenario there may unexpected behavior, may alternative getting result want without having alter project files or of custom tasks.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -