This seems to generate the correct
obj\Release\Package<projectname>.zip file when placed in
projectname.wpp.targets file next to the webproject.csproj
Parts of it is from the publishprofile I usually use.
It does indeed package the app correctly and precompiles it
(verified through unzip and checking views with false and true for
PrecompileBeforePublish) also noticed that it
compiles the App_Code folder (razor helpers) when run with
PrecompileBeforePublish in the wpp.targets file
Just ran an AppVeyor build (Couldn't wait until tomorrow ;) )
and sure enough the web deploy artifact is precompiled.
The only thing needed was that the file is present and the default
MSBUILD command that appveyor runs takes care of the rest.
Noticed one thing though! if you have
in the csproj for the configuration used for deploy then it can
fail because that will result in two aspnetcompiler calls and the
second one will fail.
But that is no problem leaving it at false for RELEASE
configuration or removing it since it will be compiled either way
with the precompile
Noticed that the projectname.wpp.targets can override the
MvcBuildViews so if we add it there we don't need
to change the csproj if we have it enabled there to find errors in
the views during development.