Skip to content

NativeDLLs: Fixes Conditionally include win-x64 native DLLs based on RuntimeIdentifier#5553

Merged
kirankumarkolli merged 33 commits into
masterfrom
copilot/fix-unconditional-dll-copying
Apr 23, 2026
Merged

NativeDLLs: Fixes Conditionally include win-x64 native DLLs based on RuntimeIdentifier#5553
kirankumarkolli merged 33 commits into
masterfrom
copilot/fix-unconditional-dll-copying

Conversation

Copilot AI commented Jan 14, 2026

Copy link
Copy Markdown
Contributor
  • Revert documentation to simpler approved version
  • Restore original indentation (6-space/10-space) for msvcp140.dll, vcruntime140.dll, vcruntime140_1.dll entries
Original prompt

This section details on the original issue you should resolve

<issue_title>Why win-x64 runtime dlls copied to output unconditionally?</issue_title>
<issue_description>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
</issue_description>

Comments on the Issue (you are @copilot in this section)

@Pilchie I suppose we could conditionally publish these, but today we rely on runtime load failures. @adityasa I believe this came up once before? Do you know if this is a duplicate?

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unconditional copying of win-x64 runtime dlls during publish Conditionally include win-x64 native DLLs based on RuntimeIdentifier Jan 14, 2026
Copilot AI requested a review from kirankumarkolli January 14, 2026 20:13
@kirankumarkolli

Copy link
Copy Markdown
Member

@copilot merge latest changes from master into this branch

Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>

Copilot AI commented Jan 14, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge latest changes from master into this branch

Merged latest changes from master in commit 9c8e4f5. The merge includes:

  • Typo fix in CosmosClientOptions.cs documentation
  • Changelog updates for versions 3.32.0-3.32.2

Comment thread Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.targets Outdated
…lusion

Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>
Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>
Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>
Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Why win-x64 runtime dlls copied to output unconditionally?

7 participants