azure-cosmos-dotnet-v3: error MSB4018: System.ArgumentException: Invalid input specification: Found multiple entries with the same BundleRelativePath

I was creating new .net core console application with just one nuget reference “Microsoft.Azure.Cosmos” and tried publish single file. And i was getting error when published: The “GenerateBundle” task failed unexpectedly. System.ArgumentException: Invalid input specification: Found multiple entries with the same BundleRelativePath.

<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp3.0</TargetFramework> <PublishSingleFile>true</PublishSingleFile> <RuntimeIdentifier>win-x64</RuntimeIdentifier> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.Azure.Cosmos" Version="3.0.0" /> </ItemGroup> </Project>

As discussed here, this is a bug in sdk. Another way it`s fix problem in a package directly.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 1
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Any update on fixing this? Still happening for - dotnet publish -c release -r win-x64 --self-contained=true /p:PublishSingleFile=true

Hi! This still repros on 3.13.0 when building a self contained. NET5 RC1 WebApi for RID win10-x64. Builds without problems when using RID linux-x64 .

Easy to reproduce by doing: dotnet new webapi -n TestApi -f net5.0 dotnet add TestApi package Microsoft.Azure.Cosmos -v 3.13.0 dotnet publish .\TestApi\TestApi.csproj -c release -r win-x64 /p:PublishSingleFile=true --self-contained

Removing the build folder (~/.nuget/packages/microsoft.azure.cosmos/3.13.0) solves the issue for win10-x64.

The targets in the package copy the native DLLs in runtimes to the output directory. When using single file publish in .NET Core 3.0, it also copies the DLLs to the output directory, by copying the whole runtimes folder to the output directory. GenerateBundle fails because it has 2 path to the native DLLs and does not know what to do, or what to pick, and throws. So it is either you fix GenerateBundle to have logic to pick, or fix in the packages by making sure it does not copy to the output directory if target framework is .NET Core 3.0.