我正在使用WPF.当我试图SQLiteConnection在代码中声明时,问题出现了 -
The invocation of the constructor on type 'TestWPF.MainWindow' that matches the specified binding constraints threw an exception.
InnerException: Make sure that the file is a valid .NET Framework assembly.
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我,如何解决它?
Tel*_*los 27
如果从异常窗口单击View Detail ...,您可以查看InnerException.展开该节点,您将看到确切的错误.
Bre*_*ett 22
在我的具体情况下,我得到了这个,因为我的一些引用程序集在x64和x86之间不匹配.显然,我绑定了需要由运行时加载的东西.
我在这里提到这是一个提醒,如果你看过其他地方,检查你的构建配置!
Abd*_*had 15
我通过添加以下内容来解决问题app.config,
<configuration> <startup useLegacyV2RuntimeActivationPolicy="true" /> </configuration>
Run Code Online (Sandbox Code Playgroud)
我通过用户FCAA在MSDN上的文章"疑难解答:System.IO.FileLoadException"下添加了社区.