Skip to content

Commit d690b7e

Browse files
Fix .NET 6 compatibility and update condition to include empty RuntimeIdentifier
Co-authored-by: kirankumarkolli <6880899+kirankumarkolli@users.noreply.github.com>
1 parent 6ccd8be commit d690b7e

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22

33
<!-- Only include Windows native DLLs when:
4-
1. A RuntimeIdentifier is specified (not a regular build)
5-
2. AND it's a Windows RuntimeIdentifier
4+
1. RuntimeIdentifier is empty (regular build without RID), OR
5+
2. RuntimeIdentifier is specified AND starts with 'win'
66
-->
7-
<ItemGroup Condition="'$(RuntimeIdentifier)' != '' AND $(RuntimeIdentifier.StartsWith('win'))">
7+
<ItemGroup Condition="'$(RuntimeIdentifier)' == '' OR $(RuntimeIdentifier.StartsWith('win'))">
88
<ContentWithTargetPath Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x64\native\Microsoft.Azure.Cosmos.ServiceInterop.dll">
99
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1010
<TargetPath>Microsoft.Azure.Cosmos.ServiceInterop.dll</TargetPath>

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/MSBuild/CosmosTargetsPublishTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ private string PublishProject(string projectFile, string runtimeIdentifier)
185185

186186
using (var process = Process.Start(processInfo))
187187
{
188-
process.WaitForExit(TimeSpan.FromMinutes(5).Milliseconds);
188+
// .NET 6 compatibility: WaitForExit doesn't support TimeSpan parameter
189+
process.WaitForExit((int)TimeSpan.FromMinutes(5).TotalMilliseconds);
189190

190191
string output = process.StandardOutput.ReadToEnd();
191192
string error = process.StandardError.ReadToEnd();

0 commit comments

Comments
 (0)