Luuk Peters (ProudNerds)
02/11/2025, 3:41 PM/opt/hostedtoolcache/dotnet/dotnet publish /home/vsts/work/1/s/Test/Test.csproj --configuration Release --output /home/vsts/work/1/a/Test'
It will fail with the following error:
/opt/hostedtoolcache/dotnet/sdk/9.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(355,5): error MSB3094: "DestinationFiles" refers to 1 item(s), and "SourceFiles" refers to 435 item(s). They must have the same number of items.
I think it something to do with the files that are being copied, but that's not something that changes between Umbraco 13 and 15 as far as I know and this pipeline has been in use for quite some time.
Test -> /home/vsts/work/1/s/TestDockerDeploymentSlot/bin/Release/net9.0/Test.dll
Copying JSON schema files into project directory: appsettings-schema.usync.json;appsettings-schema.Umbraco.Cms.json;appsettings-schema.ProudNerds.Umbraco.Core.json;appsettings-schema.ProudNerds.Umbraco.Core.Headless.json
Copying JSON schema files into project directory: umbraco-package-schema.json
Adding JSON schema references to appsettings-schema.json: https://json.schemastore.org/appsettings.json;appsettings-schema.usync.json#;appsettings-schema.Umbraco.Cms.json#;appsettings-schema.ProudNerds.Umbraco.Core.json#;appsettings-schema.ProudNerds.Umbraco.Core.Headless.json#
Because the site is practically empty and a local publish works as expected, I'm at a loss what could be causing this. The only difference is that the build pipeline is Linux and my local machine Windows. Any idea?Luuk Peters (ProudNerds)
02/11/2025, 3:55 PMxml
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<CompressionEnabled>false</CompressionEnabled> <!-- Disable compression. E.g. for umbraco backoffice files. These files should be precompressed by node and not let dotnet handle it -->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ProudNerds.Umbraco.Headless" Version="4.0.0-beta202502101" />
<PackageReference Include="Umbraco.Cms" Version="15.2.0" />
</ItemGroup>
<ItemGroup>
<!-- Opt-in to app-local ICU to ensure consistent globalization APIs across different platforms -->
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="72.1.0.3" />
<PackageReference Include="uSync" Version="15.1.1" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="72.1.0.3" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
</ItemGroup>
<ItemGroup>
<Folder Include="Views\Partials\Components\" />
</ItemGroup>
<PropertyGroup>
<!-- Razor files are needed for the backoffice to work correctly -->
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
</PropertyGroup>
</Project>
Sebastiaan
02/11/2025, 3:55 PMdotnet clean -c Release
and then:
dotnet publish MyProject1520.csproj Release --output E:\Release
Where E:\Release
is an empty folder.Sebastiaan
02/11/2025, 3:57 PM<PackageReference Include="ProudNerds.Umbraco.Headless" Version="4.0.0-beta202502101" />
? Then at least we'd know where to look.Luuk Peters (ProudNerds)
02/11/2025, 3:57 PMSebastiaan
02/11/2025, 3:58 PM<Folder Include="Views\Partials\Components\" />
is also new, so might want to try without that line on the server as well.Sebastiaan
02/11/2025, 3:58 PMkdx-perbol
02/11/2025, 4:11 PMLuuk Peters (ProudNerds)
02/11/2025, 4:15 PM/opt/hostedtoolcache/dotnet/dotnet publish /home/vsts/work/1/s/TestClassicSlot/TestClassicSlot.csproj --configuration Release --output /home/vsts/work/1/a/TestDockerDeploymentSlot' /p:PublishDir=/home/vsts/work/1/a --no-restore
/opt/hostedtoolcache/dotnet/sdk/9.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(266,5): error NETSDK1004: Assets file '/home/vsts/work/1/s/TestClassicSlot/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/home/vsts/work/1/s/TestClassicSlot/TestClassicSlot.csproj]
Luuk Peters (ProudNerds)
02/11/2025, 4:15 PMSebastiaan
02/11/2025, 4:15 PM--no-restore
will do that to you 😉Luuk Peters (ProudNerds)
02/11/2025, 4:18 PM/opt/hostedtoolcache/dotnet/sdk/9.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(355,5): error MSB3094: "DestinationFiles" refers to 1 item(s), and "SourceFiles" refers to 241 item(s). They must have the same number of items. [/home/vsts/work/1/s/TestClassicSlot/TestClassicSlot.csproj]
I'm wondering is something changed in dotnet 9 on the publish command. But this is on a completely empty Umbraco 15.2.0 project.Sebastiaan
02/11/2025, 4:19 PMLuuk Peters (ProudNerds)
02/11/2025, 4:20 PM# Publish the project to the staging directory
- task: DotNetCoreCLI@2
displayName: '.NET: publish solution'
inputs:
command: 'publish'
feedsToUse: 'select'
vstsFeed: '#REDACTED#'
arguments: '--configuration ${{ variables.configuration }} --output $(Build.ArtifactStagingDirectory)/${{ variables.solutionName }}'
zipAfterPublish: false
modifyOutputPath: false
variables.configuration = ReleaseLuuk Peters (ProudNerds)
02/11/2025, 4:20 PMD_Inventor
02/11/2025, 4:24 PMSebastiaan
02/11/2025, 4:24 PMSebastiaan
02/11/2025, 4:26 PM'
there in /home/vsts/work/1/a/TestDockerDeploymentSlot'
and the first result I get on Kagi (better than Google 😉 ) is exactly that, a path with a '
in it. https://stackoverflow.com/questions/78808252/number-of-destinationfiles-not-equal-to-sourcefiles-c-sharp-winformLuuk Peters (ProudNerds)
02/11/2025, 4:26 PMLuuk Peters (ProudNerds)
02/11/2025, 4:30 PM# The name (without the .sln extension) of the solution to build/publish release
solutionName: TestDockerDeploymentSlot'
Luuk Peters (ProudNerds)
02/11/2025, 4:31 PMSebastiaan
02/11/2025, 4:32 PMLuuk Peters (ProudNerds)
02/11/2025, 4:32 PM