locked
How to allow others to contribute to media files / folders when using Web Publish RRS feed

  • Question

  • User269881539 posted

    In my MVC app I have several folders currently user the Content folder where I put thing like brand logos / promotional images etc.

    I want to allow others to add images to these folders (at the production end) as it will be a constant task creating new images etc. 

    When I am publishing my code obviously I am stamping all over anything they may have done and replacing it with what I have locally on my copy of the app. What's the best way to allow this scenario of allowing other people to maintain the contents of these folders?

    • At the production end have folders completely outside of my app and use something like virtual dirs?
    • Just exclude the folders from my publish somehow - if so how to stop the whole folder at the production end getting wiped off when I publish?

    What is best practice?

    Thanks

    Wednesday, December 7, 2016 4:08 PM

Answers

All replies

  • User-2057865890 posted

    Hi Chilluk,

    You could refer following links, it describes how to exclude specific files and folders.

    https://www.asp.net/web-forms/overview/deployment/advanced-enterprise-web-deployment/excluding-files-and-folders-from-deployment

    https://msdn.microsoft.com/en-us/library/ee942158(v=vs.110).aspx 

    Best Regards,

    Chris

    Friday, December 9, 2016 8:32 AM
  • User269881539 posted

    I can't get this to work - every time I publish it deletes the remote folders. I created a file called ProjectName.WebUI.wpp.targets as below (assuming my project is ProjectName.WebUI):

    <Project ToolsVersion="4.0" 
             xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <ItemGroup>   
        <ExcludeFromPackageFolders Include="Content\man_logos;Content\comp_images">
          <FromTarget>ProjectName.WebUI.wpp.targets</FromTarget>
        </ExcludeFromPackageFolders>
      </ItemGroup>
    </Project>

    I have tried having the local versions of the folders as included and excluded from the project, but it just seems to always delete everything - my local copy can / will be empty but obviously I will separately be populating the remote version of the folders from our library of images.

    Monday, December 12, 2016 11:48 AM
  • User-2057865890 posted

    Hi Chilluk,

    If you select the "Remove additional files at destination" check box, the expected behavior is that Web Deploy will delete files on the destination server that you have deleted in your project. 

    reference: https://msdn.microsoft.com/en-us/library/dd465337(v=vs.110).aspx#alert_caution

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 28, 2016 8:18 AM