Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# useLegacyV2RuntimeActivationPolicy在类库项目中有效吗?_C#_Sqlite_Mixed Mode_Fileloadexception - Fatal编程技术网

C# useLegacyV2RuntimeActivationPolicy在类库项目中有效吗?

C# useLegacyV2RuntimeActivationPolicy在类库项目中有效吗?,c#,sqlite,mixed-mode,fileloadexception,C#,Sqlite,Mixed Mode,Fileloadexception,我的项目设置如下所示: 我的应用程序(4.0)-->我的类库(4.0)-->第三方库(2.0.50727) 我的应用程序的app.config如下所示: 但在尝试启动应用程序时,我收到了可怕的FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional c

我的项目设置如下所示:

我的应用程序(4.0)-->我的类库(4.0)-->第三方库(2.0.50727)

我的应用程序的app.config如下所示:


但在尝试启动应用程序时,我收到了可怕的FileLoadException:

Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
相应的第三方库是“System.Data.SQLite”v1.0.60.0。是否还需要为我的类库启用“useLegacyV2RuntimeActivationPolicy”属性?我该怎么做


提前感谢您的帮助和问候

现在已经解决了。我没有将生成的.exe.config文件与.exe-.-…一起复制。。。这完全是我的错,很抱歉。

有帮助吗?根据thread,您不需要将其添加到应用程序app.config以外的其他应用程序中。类库没有自己的
.config
文件-唯一重要的是主程序集的文件。@Default No,抱歉。。。