Copied to clipboard

Flag this post as spam?

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


  • SteveV 48 posts 212 karma points
    24 days ago
    SteveV
    0

    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 https://dev.azure.com/SteveV/winlintest/_git/winlintest
    
    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 421 posts 1724 karma points MVP 2x c-trib
    24 days ago
    Søren Gregersen
    0

    Hi,

    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 48 posts 212 karma points
    24 days ago
    SteveV
    0

    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 https://aka.ms/sdkimplicititems.
    
    The duplicate items were:
    'umbraco\PartialViewMacros\Templates\Breadcrumb.cshtml';
    'umbraco\PartialViewMacros\Templates\EditProfile.cshtml';
    'umbraco\PartialViewMacros\Templates\Empty.cshtml';
    'umbraco\PartialViewMacros\Templates\Gallery.cshtml';
    'umbraco\PartialViewMacros\Templates\ListAncestorsFromCurrentPage.cshtml';
    'umbraco\PartialViewMacros\Templates\ListChildPagesFromChangeableSource.cshtml';
    'umbraco\PartialViewMacros\Templates\ListChildPagesFromCurrentPage.cshtml';
    'umbraco\PartialViewMacros\Templates\ListChildPagesOrderedByDate.cshtml';
    'umbraco\PartialViewMacros\Templates\ListChildPagesOrderedByName.cshtml';
    'umbraco\PartialViewMacros\Templates\ListChildPagesOrderedByProperty.cshtml';
    'umbraco\PartialViewMacros\Templates\ListChildPagesWithDoctype.cshtml';
    'umbraco\PartialViewMacros\Templates\ListDescendantsFromCurrentPage.cshtml';
    'umbraco\PartialViewMacros\Templates\ListImagesFromMediaFolder.cshtml';
    'umbraco\PartialViewMacros\Templates\Login.cshtml';
    'umbraco\PartialViewMacros\Templates\LoginStatus.cshtml';
    'umbraco\PartialViewMacros\Templates\MultinodeTree-picker.cshtml';
    'umbraco\PartialViewMacros\Templates\Navigation.cshtml';
    'umbraco\PartialViewMacros\Templates\RegisterMember.cshtml';
    'umbraco\PartialViewMacros\Templates\SiteMap.cshtml';
    'umbraco\UmbracoBackOffice\AuthorizeUpgrade.cshtml';
    'umbraco\UmbracoBackOffice\Default.cshtml';
    'umbraco\UmbracoBackOffice\Preview.cshtml';
    'umbraco\UmbracoInstall\Index.cshtml';
    'umbraco\UmbracoWebsite\NoNodes.cshtml';
    'umbraco\config\appsettings-schema.json'
    

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

  • Mike Chambers 626 posts 1210 karma points c-trib
    22 days ago
    Mike Chambers
    0

    do you have

    <None Include="umbraco\**\*.*">
      <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
      <CopyToPublishDirectory>Always</CopyToPublishDirectory>
    </None>
    

    in your csproj?

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

    <Content Include="App_Plugins\**">
      <CopyToPublishDirectory>Always</CopyToPublishDirectory>
    </Content>
    <Content Include="Views\**\*.cshtml">
      <CopyToPublishDirectory>Always</CopyToPublishDirectory>
    </Content>
    <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\**">
      <CopyToPublishDirectory>Always</CopyToPublishDirectory>
    </Content>
    <Content Include="uSync\v9\**" CopyToOutputDirectory="Always" />
    
Please Sign in or register to post replies

Write your reply to:

Draft