Skip to content

Commit

Permalink
Update CsWin32 to fix dotnet build
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Jun 13, 2021
1 parent 69c33ed commit 546a678
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
18 changes: 9 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ stages:
displayName: Configure git commit author for testing
- task: UseDotNet@2
displayName: Install .NET Core SDK 5.0.202
displayName: Install .NET Core 5.0.202 SDK
inputs:
packageType: sdk
version: 5.0.202

- task: UseDotNet@2
displayName: Install .NET Core 3.1
displayName: Install .NET Core 3.1 runtime
inputs:
packageType: runtime
version: 3.1.x
Expand Down Expand Up @@ -296,17 +296,17 @@ stages:
vmImage: $(imageName)
steps:
- task: UseDotNet@2
displayName: Install .NET Core SDK 2.1.811
displayName: Install .NET Core 2.1 runtime
inputs:
packageType: sdk
version: 2.1.811
packageType: runtime
version: 2.1.x
- task: UseDotNet@2
displayName: Install .NET Core SDK 3.1.100
displayName: Install .NET Core 3.1 runtime
inputs:
packageType: sdk
version: 3.1.100
packageType: runtime
version: 3.1.x
- task: UseDotNet@2
displayName: Install .NET Core SDK 5.0.202
displayName: Install .NET Core 5.0.202 SDK
inputs:
packageType: sdk
version: 5.0.202
Expand Down
8 changes: 5 additions & 3 deletions src/NerdBank.GitVersioning/ManagedGit/FileHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
using System.IO;
using System.Runtime.InteropServices;
using Microsoft.Win32.SafeHandles;
using Microsoft.Windows.Sdk;
using Windows.Win32;
using Windows.Win32.Storage.FileSystem;
using Windows.Win32.System.SystemServices;

namespace Nerdbank.GitVersioning.ManagedGit
{
Expand All @@ -23,7 +25,7 @@ internal static bool TryOpen(string path, out FileStream? stream)
{
if (IsWindows)
{
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);
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);

if (!handle.IsInvalid)
{
Expand Down Expand Up @@ -64,7 +66,7 @@ internal static unsafe bool TryOpen(ReadOnlySpan<char> path, [NotNullWhen(true)]
HANDLE handle;
fixed (char* pPath = &path[0])
{
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);
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);
}

if (!handle.Equals(Constants.INVALID_HANDLE_VALUE))
Expand Down
2 changes: 1 addition & 1 deletion src/NerdBank.GitVersioning/NerdBank.GitVersioning.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageReference Include="DotNetMDDocs" Version="0.111.0" PrivateAssets="all" Condition=" '$(GenerateMarkdownApiDocs)' == 'true' " />
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0096" PrivateAssets="none" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.1.0" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.1.422-beta" PrivateAssets="all" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.1.478-beta" PrivateAssets="all" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />
<PackageReference Include="Validation" Version="2.5.5-beta" />
Expand Down

0 comments on commit 546a678

Please sign in to comment.