Copied to clipboard

Flag this post as spam?

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

  • SteveV 54 posts 239 karma points
    Sep 24, 2021 @ 23:27

    Missing umbraco folder after dotnet publish - 9.0.0-rc004

    I notice my build pipeline produces a broken build that is missing the umbraco folder in the root of the project. Normally this folder should contain: config, PartialViewMacros, UmbracoBackOffice, UmbracoInstall, UmbracoWebsite.

    git clone
    dotnet publish .\MySolution.sln --configuration Release --output .\release-test\`
    Microsoft (R) Build Engine version 16.11.0+0538acc04 for .NET
    Copyright (C) Microsoft Corporation. All rights reserved.
      Determining projects to restore...
      Restored C:\test-lin\winlintest\UmbLinTest\UmbLinTest.csproj (in 2,81 sec).
      UmbLinTest -> C:\test-lin\winlintest\UmbLinTest\bin\Release\net5.0\UmbLinTest.dll
      Copying Umbraco content files: C:\Users\SteveV\.nuget\packages\umbraco.cms.staticassets\9.0.0-rc004\buildTransitive\..\content\umbraco\**\*.* - #46 files
      Copying Umbraco wwwroot content files: C:\Users\SteveV\.nuget\packages\umbraco.cms.staticassets\9.0.0-rc004\buildTransitive\..\content\wwwroot\umbraco\**\*.* - #2493 files
      UmbLinTest -> C:\test-lin\winlintest\release-test\

    The command seems to restore the Umbraco folder and it's subdirectories/files just fine in the project directory but it's not there in release-test. The weird thing is that this only happens in a freshly cloned repository. When I run the dotnet publish command inside my usual project I get the expected umbraco folder.

    Is there something I'm missing?

  • Søren Gregersen 441 posts 1883 karma points MVP 2x c-trib
    Sep 25, 2021 @ 07:40
    Søren Gregersen


    We have seen it a few times - doing an explicit build before publish, ensures that the targets copying files have been run. That is also why it is working from " inside my usual project ".

    I'm not sure if this is by design or a bug in the dotnet publish tools, but umbrcao and other packages, are build according to spec.

  • SteveV 54 posts 239 karma points
    Sep 25, 2021 @ 12:10

    I just noticed when I run the publish command twice, it fails with the message:

    error NETSDK1022: Duplicate 'Content' items were included. The .NET SDK includes 'Content' items from your project directory by default.
    You can either remove these items from your project file, or set the 'EnableDefaultContentItems' property to 'false' if you want to explicitly include them in your project file.
    For more information, see
    The duplicate items were:

    Those are the files that are missing from my deployment. I will investigate further.

  • Mike Chambers 635 posts 1252 karma points c-trib
    Sep 27, 2021 @ 13:10
    Mike Chambers

    do you have

    <None Include="umbraco\**\*.*">

    in your csproj?

    We also needed to add to get everything in the published package for deployment.

    <Content Include="App_Plugins\**">
    <Content Include="Views\**\*.cshtml">
    <Content Include="appsettings.json" CopyToOutputDirectory="Always" />
    <Content Include="appsettings.Development.json" DependentUpon="appsettings.json" CopyToOutputDirectory="Always" />
    <Content Include="appsettings.Production.json" DependentUpon="appsettings.json" CopyToOutputDirectory="Always" />
    <Content Include="wwwroot\**">
    <Content Include="uSync\v9\**" CopyToOutputDirectory="Always" />
Please Sign in or register to post replies

Write your reply to: