c# - Calling a target from csproj file -
this question related clickonce project trying publish.
basically, want have target run publish each testing environment can set publishurl , publishdir accordingly.
when building project, want able call new target without using defaulttargets or adding in msbuild param. how can call target without these steps?
ex: can call target target like:
<target name="clientpublish"> <calltarget targets="publishforeachenv" /> </target>
but how call publishforeachenv target directly csproj?
hope makes sense
i'm not quite sure mean, i'll take crack @ it.
to edit csproj, right click on in solution explorer, select unload project. once becomes greyed out , unavailable in solution explorer, right click on again , select edit [your project name].
the file in xml, can sort in there. if towards bottom you'll see target file imports, , should see empty target each beforebuild , afterbuild. can add call custom target here, afterbuild appropriate you. include custom target inline in csproj, or in import file.
you'll have go solution explorer, right click on project , select reload project changes take effect.
additionally there option: add post build event prints value interested in build ouput window:
so, means solution explorer, right click on project, select properties, build events, edit post-build.
you should able want entering line
echo "my publish url is: '$(publishurl)' "
note publishurl
not available in macros list, can still use entering manually - list contains common macros.
Comments
Post a Comment