File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed
Yubico.Core/src/Yubico/PlatformInterop
Yubico.NativeShims/msbuild Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 16
16
17
17
using System ;
18
18
using System . IO ;
19
+ using System . Runtime . InteropServices ;
19
20
20
21
namespace Yubico . PlatformInterop
21
22
{
@@ -72,9 +73,13 @@ private static class Net47Implementation
72
73
private static string NativeShimsPath =>
73
74
Path . Combine (
74
75
AppDomain . CurrentDomain . BaseDirectory ,
75
- Environment . Is64BitProcess
76
- ? "x64"
77
- : "x86" ,
76
+ RuntimeInformation . OSArchitecture switch
77
+ {
78
+ Architecture . X86 => "x86" ,
79
+ Architecture . X64 => "x64" ,
80
+ Architecture . Arm64 => "arm64" ,
81
+ var unsupportedArch => throw new ArgumentOutOfRangeException ( $ "Architecture { unsupportedArch } is not supported!")
82
+ } ,
78
83
NativeShims ) ;
79
84
80
85
/// <summary>
Original file line number Diff line number Diff line change 9
9
<!-- x86 -->
10
10
<ItemGroup Condition =" '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X86' OR '$(Platform)' == 'x86'" >
11
11
<Content Include =" $(MSBuildThisFileDirectory)..\..\runtimes\win-x86\native\Yubico.NativeShims.dll" >
12
- <Link >Yubico.NativeShims.dll</Link >
12
+ <Link >x86\ Yubico.NativeShims.dll</Link >
13
13
<CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
14
14
<Visible >false</Visible >
15
15
</Content >
18
18
<!-- x64 -->
19
19
<ItemGroup Condition =" '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'X64' OR '$(Platform)' == 'x64'" >
20
20
<Content Include =" $(MSBuildThisFileDirectory)..\..\runtimes\win-x64\native\Yubico.NativeShims.dll" >
21
- <Link >Yubico.NativeShims.dll</Link >
21
+ <Link >x64\ Yubico.NativeShims.dll</Link >
22
22
<CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
23
23
<Visible >false</Visible >
24
24
</Content >
25
25
</ItemGroup >
26
26
27
27
<!-- Arm64 -->
28
- <ItemGroup Condition =" '$(Platform)' == 'arm64'" >
28
+ <ItemGroup Condition =" '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'Arm64' OR '$( Platform)' == 'arm64'" >
29
29
<Content Include =" $(MSBuildThisFileDirectory)..\..\runtimes\win-arm64\native\Yubico.NativeShims.dll" >
30
- <Link >Yubico.NativeShims.dll</Link >
30
+ <Link >arm64\ Yubico.NativeShims.dll</Link >
31
31
<CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
32
32
<Visible >false</Visible >
33
33
</Content >
45
45
<CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
46
46
<Visible >false</Visible >
47
47
</Content >
48
+ <Content Include =" $(MSBuildThisFileDirectory)..\..\runtimes\win-arm64\native\Yubico.NativeShims.dll" >
49
+ <Link >arm64\Yubico.NativeShims.dll</Link >
50
+ <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
51
+ <Visible >false</Visible >
52
+ </Content >
48
53
</ItemGroup >
49
- </Project >
54
+ </Project >
You can’t perform that action at this time.
0 commit comments