Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Meni 273 posts 530 karma points
    Feb 08, 2023 @ 07:12
    Meni
    0

    Umbraco 11: Where should I put / upload media folder when do dotnet publish?

    Hi, I just deployed my Umbraco 11 website.

    I did

    dotnet published
    

    in the CLI and then copied the content of bin/Debug/net7.0/publish to my ftp.

    The website is coming, but most of the media is not there. Only the images of the homepage (not all of them - one section is missing).

    I noticed that the /publish folder size is ~ 280mb but my media folder is 1.54GB !

    So where should I upload the media folder in the ftp?

    Thanks.

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Feb 08, 2023 @ 08:26
    Huw Reddick
    0

    the media folder should sit under wwwroot

  • Meni 273 posts 530 karma points
    Feb 08, 2023 @ 16:26
    Meni
    0

    Right. And this is where I put them while running on local. But when I did dotnet publish it didn’t include the media. Should I just copy it manually after do dotnet publish?

  • Caley 14 posts 125 karma points
    Feb 08, 2023 @ 09:50
    Caley
    0

    Hi Meni

    To your .csproj file you can add;

      <ItemGroup>
        <None Include="wwwroot\**">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
      </ItemGroup>
    

    That will copy all contents from the wwwroot including your media folder to your publish folder on build.

    See this question: https://stackoverflow.com/questions/51341844/some-files-in-wwwroot-folder-are-not-published-in-asp-net-core-web-deploy

Please Sign in or register to post replies

Write your reply to:

Draft