Is there a target in Visual Studio 2012 that will run when the project opens? -
tl;dr have command run open project in visual studio 2012. how achieve this?
longer version
to make front-end parts of project build automatically in visual studio have specified in project file:
<propertygroup label="nodejs"> <nodejspath>$(msbuildprojectdirectory)\..\..\tools\nodejs</nodejspath> </propertygroup> <target name="beforebuild"> <exec command="$(nodejspath)\npm install" /> <exec command="$(nodejspath)\npm run test" /> <exec command="$(nodejspath)\npm run build-all" /> </target>
this fine, means sass changes not built while project running. i'd have sass continually compiled after opening project in visual studio without of back-enders needing know node process doing all. means need run npm install
, npm run watch-sass
on project startup.
i know visual studio 2015 npm install
sees package.json
, want replicate.
the following targets executed when project opens in visual studio:
design-time target execution
visual studio attempts execute targets names when loads project. these targets include
compile
,resolveassemblyreferences
,resolvecomreferences
,getframeworkpaths
, ,copyrunenvironmentfiles
. visual studio runs these targets compiler can initialized provide intellisense, debugger can initialized, , references displayed in solution explorer can resolved. if these targets not present, project load , build correctly design-time experience in visual studio not functional.
you may want stick condition on target prevent loading on build server or when building solution commandline:
<target ... condition="'$(buildinginsidevisualstudio)' == 'true'">
but easier upgrade visual studio 2013 or 2015 make use of new task runner built-into visual studio 2015 , ships extension visual studio 2013. can be extended support other task runners well.
Comments
Post a Comment