Skip to content

Why win-x64 runtime dlls copied to output unconditionally? #5532

@inikulshin

Description

@inikulshin

Describe the bug
When I dotnet publish project that references Microsoft.Azure.Cosmos package with -r linux-x64, all the files from runtimes\win-x64\native are always copied to output directory.

Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.targets:

  <ItemGroup>
    <ContentWithTargetPath Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x64\native\Microsoft.Azure.Cosmos.ServiceInterop.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <TargetPath>Microsoft.Azure.Cosmos.ServiceInterop.dll</TargetPath>
      <Visible>False</Visible>
    </ContentWithTargetPath>
  </ItemGroup>

Imo, it should be conditional only for win* RuntimeIdentifier or when building on Windows.

To Reproduce
dotnet publish project that references Microsoft.Azure.Cosmos package with -r linux-x64

Expected behavior
No Windows dlls, such as vcruntime140.dll in output directory,

Actual behavior
There are Windows dlls, such as vcruntime140.dll in output directory,

Environment summary
SDK Version: ---
OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions