tag:help.appveyor.com,2012-11-13:/discussions/problems/853-adding-files-to-a-web-deployAppVeyor: Discussion 2018-08-25T01:49:44Ztag:help.appveyor.com,2012-11-13:Comment/348061222014-10-01T21:54:08Z2014-10-01T21:54:08ZAdding files to a Web Deploy<div><p>How do you build web deploy package?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/348061222014-10-01T21:58:39Z2014-10-01T21:58:39ZAdding files to a Web Deploy<div><p>Thats a good question! Locally, I am not building the package, I
am simply deploying it using the "Publish..." option in Visual
Studio.</p>
<p>Note: all the filles that I want are added ... it just looks
like the first set is added on top of the second.</p></div>Michael Huenschtag:help.appveyor.com,2012-11-13:Comment/348061222014-10-01T21:59:37Z2014-10-01T21:59:37ZAdding files to a Web Deploy<div><p>Note: I saw this discussion - <a href=
"http://help.appveyor.com/discussions/kb/8-webdeploy-additional-files">
http://help.appveyor.com/discussions/kb/8-webdeploy-additional-files</a></p>
<p>I'd be willing to try it, but it seems a little bit weird to us
a PS script when MS provides a way to add files to the web deploy
through msbuild.</p></div>Michael Huenschtag:help.appveyor.com,2012-11-13:Comment/348061222014-10-01T22:01:54Z2014-10-01T22:01:54ZAdding files to a Web Deploy<div><p>See attached file:</p>
<pre>
<code><PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CollectAppFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
CollectAppFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CollectBrochureContentFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
CollectBrochureContentFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
<CopyAllFilesToSingleFolderForPackageDependsOn>
CollectBrochureFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
CollectBrochureFiles;
$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup></code>
</pre>
<p>Maybe I just need to separate these out into separate targets
files?</p></div>Michael Huenschtag:help.appveyor.com,2012-11-13:Comment/348061222014-10-01T22:34:03Z2014-10-01T22:34:03ZAdding files to a Web Deploy<div><p>AppVeyor generates <code>appveyor.pubxml</code> to publish WAP
and I'm not sure your targets are called. Try adding some message
into it to see if that's true.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/348061222014-10-02T17:58:57Z2014-10-02T17:58:57ZAdding files to a Web Deploy<div><p>I put a Message line in my targets file and I can see that the
task was executed:</p>
<pre>
<code> Web -> C:\projects\foogenda\Web\bin\Server.dll
412 Transformed Web.config using C:\projects\foogenda\Web\Web.Release.config into obj\Release\TransformWebConfig\transformed\Web.config.
413 Auto ConnectionString Transformed obj\Release\TransformWebConfig\transformed\Web.config into obj\Release\CSAutoParameterize\transformed\Web.config.
**414 !!!HERE!!!**
415 Copying all files to temporary location below for package/publish:
416 obj\Release\Package\PackageTmp.
417C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Microsoft.Web.Publishing.targets(25</code>
</pre>
<p>I assume that this works because the task is part of the normal
csproj build process and it simply tells msbuild (or whatever) to
include the files as part of the deployment package.</p></div>Michael Huenschtag:help.appveyor.com,2012-11-13:Comment/348061222014-10-02T18:02:10Z2014-10-02T18:02:10ZAdding files to a Web Deploy<div><p>Interesting. Have to give it a try. Would it be possible for you
to create a small "sample" WAP project demonstrating this
technique?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/348061222014-10-02T18:22:18Z2014-10-02T18:22:18ZAdding files to a Web Deploy<div><p>Here is the tutorial from ASP.Net: <a href=
"http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deployment/deploying-extra-files">
http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deplo...</a>
There is a starter project that should do what you want as its what
I used to create my project.</p>
<p>I will try and work on a similar project that exposes the error
I am seeing.</p>
<p>Note: Its entirely possible that its something weird I am doing
on my side - I just don't know how to trouble shoot it on
Appveyor.</p></div>Michael Huenschtag:help.appveyor.com,2012-11-13:Comment/348061222014-10-02T18:24:09Z2014-10-02T18:24:09ZAdding files to a Web Deploy<div><p>Cool, thanks for the link!</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/348061222014-10-03T14:13:02Z2014-10-03T14:13:02ZAdding files to a Web Deploy<div><p>I found the problem. The issue wasn't the task that adds the
file to the build. It was a separate task I added to change the
length of the file names when trying to trouble shoot the name too
long exception. I removed that task and everything works now.</p>
<p>Thanks again for helping me to look at this!</p></div>Michael Huenschtag:help.appveyor.com,2012-11-13:Comment/348061222014-10-03T14:14:41Z2014-10-03T14:14:41ZAdding files to a Web Deploy<div><p>Cool, thanks for the update!-Feodor</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/348061222014-11-06T18:05:48Z2014-11-06T18:05:49ZAdding files to a Web Deploy<div><p>I've got a similar issue, trying to build & package (and
ultimately deploy, but one step at a time) an Umbraco project.</p>
<p>The Umbraco nuget package adds imports to the csproj to
automatically ensure that files are packaged & deployed (see
<a href=
"https://github.com/umbraco/Umbraco-CMS/tree/7.1.6/build/NuSpecs/build">
https://github.com/umbraco/Umbraco-CMS/tree/7.1.6/build/NuSpecs/build</a>).
Running in TeamCity (or from a command line), this works fine when
DeployOnBuild=true is set; the files get added to the package as
expected.</p>
<p>This isn't happening here; a verbose build log seems to suggest
that the added AddUmbracoFilesToOutput target runs inside the
CopyAllFilesToSingleFolderForMsdeploy OK, but somehow the files
don't end up in the package/artifact.</p>
<p>AppVeyor seems to use the target "PackageUsingManifest", and
that manifest doesn't include the injected files.</p>
<p>Any ideas how I can resolve this?</p></div>Phil Dyetag:help.appveyor.com,2012-11-13:Comment/348061222014-11-06T18:46:15Z2014-11-06T18:46:15ZAdding files to a Web Deploy<div><p>A simplest solution is to don't use AppVeyor built-in packaging
for WAP and use your own <code>msbuild</code> command for building
a package.</p>
<p>Alternatively, have you tried adding files in "BeforeBuild"
target of WAP?</p>
<p>This is what we have in our website project file to make it work
with Azure Web Sites:</p>
<pre>
<code> <Target Name="BeforeBuild">
<ItemGroup>
<Content Include="site\**\*" />
</ItemGroup>
</Target></code>
</pre></div>Feodor Fitsner