Skip to content

Commit 546a678

Browse files
committed
Update CsWin32 to fix dotnet build
1 parent 69c33ed commit 546a678

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

azure-pipelines.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ stages:
5858
displayName: Configure git commit author for testing
5959
6060
- task: UseDotNet@2
61-
displayName: Install .NET Core SDK 5.0.202
61+
displayName: Install .NET Core 5.0.202 SDK
6262
inputs:
6363
packageType: sdk
6464
version: 5.0.202
6565

6666
- task: UseDotNet@2
67-
displayName: Install .NET Core 3.1
67+
displayName: Install .NET Core 3.1 runtime
6868
inputs:
6969
packageType: runtime
7070
version: 3.1.x
@@ -296,17 +296,17 @@ stages:
296296
vmImage: $(imageName)
297297
steps:
298298
- task: UseDotNet@2
299-
displayName: Install .NET Core SDK 2.1.811
299+
displayName: Install .NET Core 2.1 runtime
300300
inputs:
301-
packageType: sdk
302-
version: 2.1.811
301+
packageType: runtime
302+
version: 2.1.x
303303
- task: UseDotNet@2
304-
displayName: Install .NET Core SDK 3.1.100
304+
displayName: Install .NET Core 3.1 runtime
305305
inputs:
306-
packageType: sdk
307-
version: 3.1.100
306+
packageType: runtime
307+
version: 3.1.x
308308
- task: UseDotNet@2
309-
displayName: Install .NET Core SDK 5.0.202
309+
displayName: Install .NET Core 5.0.202 SDK
310310
inputs:
311311
packageType: sdk
312312
version: 5.0.202

src/NerdBank.GitVersioning/ManagedGit/FileHelpers.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
using System.IO;
66
using System.Runtime.InteropServices;
77
using Microsoft.Win32.SafeHandles;
8-
using Microsoft.Windows.Sdk;
8+
using Windows.Win32;
9+
using Windows.Win32.Storage.FileSystem;
10+
using Windows.Win32.System.SystemServices;
911

1012
namespace Nerdbank.GitVersioning.ManagedGit
1113
{
@@ -23,7 +25,7 @@ internal static bool TryOpen(string path, out FileStream? stream)
2325
{
2426
if (IsWindows)
2527
{
26-
var handle = PInvoke.CreateFile(path, FILE_ACCESS_FLAGS.FILE_GENERIC_READ, FILE_SHARE_FLAGS.FILE_SHARE_READ, lpSecurityAttributes: null, FILE_CREATE_FLAGS.OPEN_EXISTING, FILE_FLAGS_AND_ATTRIBUTES.FILE_ATTRIBUTE_NORMAL, null);
28+
var handle = PInvoke.CreateFile(path, FILE_ACCESS_FLAGS.FILE_GENERIC_READ, FILE_SHARE_MODE.FILE_SHARE_READ, lpSecurityAttributes: null, FILE_CREATION_DISPOSITION.OPEN_EXISTING, FILE_FLAGS_AND_ATTRIBUTES.FILE_ATTRIBUTE_NORMAL, null);
2729

2830
if (!handle.IsInvalid)
2931
{
@@ -64,7 +66,7 @@ internal static unsafe bool TryOpen(ReadOnlySpan<char> path, [NotNullWhen(true)]
6466
HANDLE handle;
6567
fixed (char* pPath = &path[0])
6668
{
67-
handle = PInvoke.CreateFile(pPath, FILE_ACCESS_FLAGS.FILE_GENERIC_READ, FILE_SHARE_FLAGS.FILE_SHARE_READ, null, FILE_CREATE_FLAGS.OPEN_EXISTING, FILE_FLAGS_AND_ATTRIBUTES.FILE_ATTRIBUTE_NORMAL, default);
69+
handle = PInvoke.CreateFile(pPath, FILE_ACCESS_FLAGS.FILE_GENERIC_READ, FILE_SHARE_MODE.FILE_SHARE_READ, null, FILE_CREATION_DISPOSITION.OPEN_EXISTING, FILE_FLAGS_AND_ATTRIBUTES.FILE_ATTRIBUTE_NORMAL, default);
6870
}
6971

7072
if (!handle.Equals(Constants.INVALID_HANDLE_VALUE))

src/NerdBank.GitVersioning/NerdBank.GitVersioning.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageReference Include="DotNetMDDocs" Version="0.111.0" PrivateAssets="all" Condition=" '$(GenerateMarkdownApiDocs)' == 'true' " />
1313
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0096" PrivateAssets="none" />
1414
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.1.0" />
15-
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.1.422-beta" PrivateAssets="all" />
15+
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.1.478-beta" PrivateAssets="all" />
1616
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
1717
<PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />
1818
<PackageReference Include="Validation" Version="2.5.5-beta" />

0 commit comments

Comments
 (0)