Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Problems to deploy assets from a referenced project

Hi,
I'm facing a strange issue when my project is deployed on appharbor.
I have a web application that references a class library. This class library contains resources files with the right Build Action as defined here
http://support.appharbor.com/kb/getting-started/deploying-certain-a....

The project structure looks like the following :

+---ClassLibrary1
|   \---Resources
|       +---en
|       |       Strings.po
|       |       TextFile1.txt
|       |       
|       \---fr
|               Strings.po
|               TextFile1.txt
|               
+---MvcApplication1

After compilation, the bin folder contains as expected :

|   +---bin
|   |   +---Resources
|   |   |   +---en
|   |   |   |       Strings.po
|   |   |   |       TextFile1.txt
|   |   |   |       
|   |   |   \---fr
|   |   |           Strings.po
|   |   |           TextFile1.txt
|   |   |

But when I download the build from appharbor, the _PublishedWebsites\bin folder contains only one Strings.po and one TextFile1.txt file. The Resources folder and its subfolders have disappeared.

Looking at the build log, I can see the following att the end :

         Copying file from "D:\temp\qssidje2.iq2\input\ClassLibrary1\Resources\en\Strings.po" to "D:\temp\qssidje2.iq2\output\_PublishedWebsites\MvcApplication1\bin\Strings.po".
         Copying file from "D:\temp\qssidje2.iq2\input\ClassLibrary1\Resources\fr\TextFile1.txt" to "D:\temp\qssidje2.iq2\output\_PublishedWebsites\MvcApplication1\bin\TextFile1.txt".
         Copying file from "D:\temp\qssidje2.iq2\input\ClassLibrary1\Resources\en\TextFile1.txt" to "D:\temp\qssidje2.iq2\output\_PublishedWebsites\MvcApplication1\bin\TextFile1.txt".
         Copying file from "D:\temp\qssidje2.iq2\input\ClassLibrary1\Resources\fr\Strings.po" to "D:\temp\qssidje2.iq2\output\_PublishedWebsites\MvcApplication1\bin\Strings.po".

So it seems the files are "flattened" to the published directory.

Am I doing something wrong ?

  1. Hi,

    The "Copy Always" approach won't preserve the directory structure, but there are a few other ways to approach this. For instance you could simply copy the files using a PostBuildEvent in your WebApplication1.csproj. Something like this should do the trick:

    <PropertyGroup>
        <PostBuildEvent>
            if not exist "$(WebProjectOutputDir)\bin\Resources" md "$(WebProjectOutputDir)\bin\Resources"
            start /MIN xcopy /s /y /R "$(SolutionDir)ClassLibrary1\Resources\*.*" "$(WebProjectOutputDir)\bin\Resources"
        </PostBuildEvent>
    </PropertyGroup>
    

    Let me know how that works out!

    Best,
    Rune

  2. Hi,

    Thanks for your answer.
    Meanwhile we've found this similar question on appharbor support http://support.appharbor.com/discussions/problems/57456-runtime-dir..., and we also have removed the directory structure and named the files differently.
    Thanks for your help

    Pascal

  3. Yes both approaches should work well and do what you want - good to hear you were able to find a solution for your use case!

    Best,
    Rune

  4. rune closed this discussion on 09 Oct, 2014 10:12 PM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

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