My main goal is to add minified JS scripts to the deployment package of my ASP.NET web application using cmd
.
Also my question may seem duplicate to this topic and even this and this, it's not the case.
My problem is that I've tried hooking into CopyAllFilesToSingleFolderForPackageDependsOn
, CopyAllFilesToSingleFolderForMsdeployDependsOn
and even PipelineCollectFilesPhaseDependsOn
with no luck. I used <Message Text="Inside of CustomCollectFiles" Importance="high"/>
inside my custom Target
as Sayed Ibrahim Hashimi proposed in his answer and /v:diag
switch of msbuild.exe
to verify this fact. I have no ideas how to fix it: tried to place corresponding XML snippet with different modifications from the questions above into .csproj
file directly and also into a separate file .wpp.targets
which is used to customize packaging.
My dev environment includes VS2010 and VS2013, I've installed Web Deployment 3.5 via Web PI, Web Deployment Tools, Windows Azure SDK. My system PATH environment var includes c:\Windows\Microsoft.NET\Framework64\v4.0.30319\;c:\Program Files\IIS\Microsoft Web Deploy V3
to be able to run MSBuild
and MSDeploy
from cmd
. When I look into the MSBuild log I see this:
CopyAllFilesToSingleFolderForMsdeployDependsOn =
;
;
CopyAllFilesToSingleFolderForPackageDependsOn =
;
;
;
some stuff goes here
PipelineDeployPhaseDependsOn =
;
Package;
So my question is where to find the source of my misfunctioning packaging pipeline? What additional kind of diagnostics I missed out?
It seems that probably MSBuild cached build targets terribly wrong, but after Windows restart all kinds of hooking including the one from this post which finally solved my problem started to work as expected.
Also, for all who are doing automatic build stuff it might be interesting to note that web deplopy related stuff can be moved from the main
{Project Name}.csproj
file to the corresponding{Project Name}.wpp.targets
file which I consider as a more elegant way of configuring build options especially if you don't want to include them in the TFS or want to customize build befaviour for different publish targets.So, this is my final
.wpp.targets
file which works for me now: