我有一个针对net452
、net461
和的测试项目netcoreapp20
。一切运行良好net452
,netcoreapp20
但是,当我运行时,net461
我得到了System.TypeInitializationException
这是堆栈跟踪
Unhandled exception: System.TypeInitializationException: The type initializer for "MyApp.SomeClass" threw an exception. ---> System.ArgumentException: Path is invalid.
in System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
in System.IO.Path.InternalGetDirectoryName(String path)
in SQLitePCL.NativeLibrary.MakePossibilitiesFor(String basename, Assembly assy, Int32 flags, LibSuffix suffix)
in SQLitePCL.NativeLibrary.MyLoad(String basename, Assembly assy, Int32 flags, Action`1 log)
in SQLitePCL.NativeLibrary.Load(String libraryName, Assembly assy, Int32 flags)
in SQLitePCL.Batteries_V2.MakeDynamic(String name, Int32 flags)
in SQLitePCL.Batteries_V2.DoDynamic_cdecl(String name, Int32 flags)
in SQLitePCL.Batteries_V2.Init()
我检查了我的测试项目的项目输出,所有的 DLL 都在那里以及SQLite.Interop.dll
in./x86/
和./x64/
顺便说一下我的主要项目,我正在使用 Microsoft.Data.Sqlite 并且我的目标是net40
, net461
, 和netstandard20