Skip to content

Commit 1fe3211

Browse files
authored
Merge pull request #92 from dariooo512/master
Adding catch case for handling FileNotFound exception when using dll from .NET Core
2 parents e1e7e34 + 6299d70 commit 1fe3211

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

NeuralNetwork.NET/cuDNN/CuDnnService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.IO;
23
using System.Linq;
34
using System.Threading;
45
using Alea;
@@ -75,7 +76,7 @@ public static bool IsAvailable
7576
// Calling this directly could cause a crash in the <Module> loader due to the missing .dll files
7677
return CuDnnSupportHelper.IsGpuAccelerationSupported();
7778
}
78-
catch (TypeInitializationException)
79+
catch (Exception e) when (e is FileNotFoundException || e is TypeInitializationException)
7980
{
8081
// Missing .dll file
8182
return false;

0 commit comments

Comments
 (0)