如何在多个项目中使用 useLegacyV2RuntimeActivationPolicy?

发布于 2024-10-29 21:55:23 字数 1040 浏览 1 评论 0原文

我正在尝试将手写识别功能作为库包含到包含多个项目的 WPF .NET 4 解决方案中。因此,我想在 Win7 x64 上使用 IAWinFX.dll(平板电脑 SDK 1.7) - 但在运行 BackgroundAnalyze 时出现以下错误:

“混合模式程序集是针对运行时版本‘v1.0.3705’构建的,无法加载4.0 运行时无需附加配置信息。”

我已经尝试按照此处的建议修改相应的 .config 文件(设置 useLegacyV2RuntimeActivationPolicy="true"): http://social.msdn.microsoft.com/Forums/fi-FI/wpf/thread/6acf2aab-29c4-4754-95eb-cb2d717c5a2e

我还将构建目标设置为 x86,并在主应用程序上更改了此设置。主应用程序的配置还设置了 useLegacyV2RuntimeActivationPolicy="true"。

由于我已经被这个问题困扰了几天,我一直在寻找解决方案,因此也尝试禁用“生成序列化程序集”选项,如下所示:https://support.softwarekey.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=140

但这些尝试都没有给我带来有效的 InkAnalysis...我还能做什么?是否有一个解决方案范围的 .config 文件,我可以在其中设置 useLegacyV2RuntimeActivationPolicy 选项?或者我是否需要将此选项添加到解决方案中的每个项目?

提前致谢!

i'm trying to include handwriting recognition capabilities as a library into a WPF .NET 4 Solution containing multiple projects. Therefore i wanted to use the IAWinFX.dll (tablet PC SDK 1.7) on Win7 x64 - but when running BackgroundAnalyze i get the following error:

"Mixed mode assembly is built against version 'v1.0.3705' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information."

I already tried modifying the corresponding .config file (set useLegacyV2RuntimeActivationPolicy="true") as recommended here: http://social.msdn.microsoft.com/Forums/fi-FI/wpf/thread/6acf2aab-29c4-4754-95eb-cb2d717c5a2e .

I've also set the build target to x86 and changed this on the main application as well. The main application's config also has the useLegacyV2RuntimeActivationPolicy="true" set.

Since i'm stuck with this problem a few days already i've been looking for a solution and thus also tried disabling the "Generate serialization assembly" option as suggested here: https://support.softwarekey.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=140

but none of those attempts gave me a working InkAnalysis... What else can i do? Is there a solutionwide .config file where i might set the useLegacyV2RuntimeActivationPolicy option? Or do i need to add this option to every project in the solution?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

余罪 2024-11-05 21:55:23

不知道这种情况下的 SO 做法是什么。我将重复我的评论作为答案,并稍微扩展一下,以便可以关闭问题。

-

使用的唯一配置文件是用于启动应用程序的 .exe 文件(我认为这就是您所说的“主应用程序的配置”)。

(设置也从 machine.config 和 user.config 中读取,但其中的值通常会被应用程序配置覆盖)

如果您在 VS 内运行,请确保该文件名为 app.config。< br>
VS 会自动将其复制到输出文件夹并将其重命名为 myapp.exe.configmyapp.vshost.exe.config

Don't know what the SO practice is for this case. I'll repeat my comment as an answer and expand it a bit so the question can be closed.

-

The only config file used is the one for the .exe you use to start the application (which I assume is what you call "main application's config").

(Settings are also read from machine.config and user.config but values in there are normally overridden by the app config)

If you are running inside VS, ensure that the file is called app.config.
VS will automatically copy it to the output folder and rename it to myapp.exe.config and myapp.vshost.exe.config.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文