12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
- using System ;
15
+ // As long as we have the Libraries.Net47.cs class which holds the opposite preprocessor directive check,
16
+ // this check is required - as having both at the same time is not possible.
17
+ #if ! NET47
16
18
17
19
namespace Yubico . PlatformInterop
18
20
{
@@ -35,34 +37,6 @@ namespace Yubico.PlatformInterop
35
37
/// </remarks>
36
38
internal static partial class Libraries
37
39
{
38
- #if NET47
39
- /// <summary>
40
- /// The filename of the native shims library for .NET Framework 4.7.
41
- /// </summary>
42
- /// <remarks>
43
- /// For .NET Framework 4.7, the DLL must be placed in an architecture-specific subdirectory:
44
- /// - x86/Yubico.NativeShims.dll for 32-bit processes
45
- /// - x64/Yubico.NativeShims.dll for 64-bit processes
46
- /// The correct version is loaded at runtime based on the process architecture.
47
- /// </remarks>
48
- internal const string NativeShims = "Yubico.NativeShims.dll" ;
49
-
50
- /// <summary>
51
- /// Ensures the native library is properly loaded for .NET Framework 4.7.
52
- /// </summary>
53
- /// <exception cref="DllNotFoundException">
54
- /// Thrown when the native library cannot be loaded. This could be due to:
55
- /// - Missing DLL file in the architecture-specific directory (x86/x64)
56
- /// - Incorrect architecture (x86/x64 mismatch)
57
- /// - Missing dependencies
58
- /// - Insufficient permissions
59
- /// </exception>
60
- /// <remarks>
61
- /// This method must be called before any P/Invoke calls are made.
62
- /// The implementation details are handled in Libraries.Net47.cs.
63
- /// </remarks>
64
- public static void EnsureInitialized ( ) => Net47Implementation . Initialize ( ) ;
65
- #else
66
40
/// <summary>
67
41
/// The filename of the native shims library for modern .NET versions.
68
42
/// </summary>
@@ -81,6 +55,6 @@ internal static partial class Libraries
81
55
/// This method exists only for API compatibility with .NET Framework 4.7 code.
82
56
/// </remarks>
83
57
public static void EnsureInitialized ( ) { }
84
- #endif
85
58
}
86
59
}
60
+ #endif
0 commit comments