Adding files to a Web Deploy

Michael Huensch's Avatar

Michael Huensch

01 Oct, 2014 09:47 PM

I am adding files created by my Node.js to my web deployment via the attached .targets file. I am having problems with 4 files in particular:

1. Index.html
2. Index.css
3. app\Index.html
4. app\Index.css

When the build and deployment has completed, the artifact zip file has overwritten app\index.html and app\index.css with the index.html and index.css from the root of the project.

This only happens on AppVeyor. When I run the build locally and deploy to the local filesystem - everything works as expected.

Any suggestions?

  1. Support Staff 1 Posted by Feodor Fitsner on 01 Oct, 2014 09:54 PM

    Feodor Fitsner's Avatar

    How do you build web deploy package?

  2. 2 Posted by Michael Huensch on 01 Oct, 2014 09:58 PM

    Michael Huensch's Avatar

    Thats a good question! Locally, I am not building the package, I am simply deploying it using the "Publish..." option in Visual Studio.

    Note: all the filles that I want are added ... it just looks like the first set is added on top of the second.

  3. 3 Posted by Michael Huensch on 01 Oct, 2014 09:59 PM

    Michael Huensch's Avatar

    Note: I saw this discussion - http://help.appveyor.com/discussions/kb/8-webdeploy-additional-files

    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.

  4. 4 Posted by Michael Huensch on 01 Oct, 2014 10:01 PM

    Michael Huensch's Avatar

    See attached file:

    <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>

    Maybe I just need to separate these out into separate targets files?

  5. Support Staff 5 Posted by Feodor Fitsner on 01 Oct, 2014 10:34 PM

    Feodor Fitsner's Avatar

    AppVeyor generates appveyor.pubxml to publish WAP and I'm not sure your targets are called. Try adding some message into it to see if that's true.

  6. 6 Posted by Michael Huensch on 02 Oct, 2014 05:58 PM

    Michael Huensch's Avatar

    I put a Message line in my targets file and I can see that the task was executed:

     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
    

    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.

  7. Support Staff 7 Posted by Feodor Fitsner on 02 Oct, 2014 06:02 PM

    Feodor Fitsner's Avatar

    Interesting. Have to give it a try. Would it be possible for you to create a small "sample" WAP project demonstrating this technique?

  8. 8 Posted by Michael Huensch on 02 Oct, 2014 06:22 PM

    Michael Huensch's Avatar

    Here is the tutorial from ASP.Net: http://www.asp.net/mvc/tutorials/deployment/visual-studio-web-deplo... There is a starter project that should do what you want as its what I used to create my project.

    I will try and work on a similar project that exposes the error I am seeing.

    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.

  9. Support Staff 9 Posted by Feodor Fitsner on 02 Oct, 2014 06:24 PM

    Feodor Fitsner's Avatar

    Cool, thanks for the link!

  10. 10 Posted by Michael Huensch on 03 Oct, 2014 02:13 PM

    Michael Huensch's Avatar

    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.

    Thanks again for helping me to look at this!

  11. Support Staff 11 Posted by Feodor Fitsner on 03 Oct, 2014 02:14 PM

    Feodor Fitsner's Avatar

    Cool, thanks for the update!-Feodor

  12. 12 Posted by Phil Dye on 06 Nov, 2014 06:05 PM

    Phil Dye's Avatar

    I've got a similar issue, trying to build & package (and ultimately deploy, but one step at a time) an Umbraco project.

    The Umbraco nuget package adds imports to the csproj to automatically ensure that files are packaged & deployed (see https://github.com/umbraco/Umbraco-CMS/tree/7.1.6/build/NuSpecs/build). 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.

    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.

    AppVeyor seems to use the target "PackageUsingManifest", and that manifest doesn't include the injected files.

    Any ideas how I can resolve this?

  13. Support Staff 13 Posted by Feodor Fitsner on 06 Nov, 2014 06:46 PM

    Feodor Fitsner's Avatar

    A simplest solution is to don't use AppVeyor built-in packaging for WAP and use your own msbuild command for building a package.

    Alternatively, have you tried adding files in "BeforeBuild" target of WAP?

    This is what we have in our website project file to make it work with Azure Web Sites:

      <Target Name="BeforeBuild">
        <ItemGroup>
          <Content Include="site\**\*" />
        </ItemGroup>
      </Target>
    
  14. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:49 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

 

01 Oct, 2024 04:27 PM
26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM