首页 文章

EmguCV和UWP - 无法解析程序集或Windows元数据文件'System.Windows.Forms.dll'(Emgu.CV.UI)

提问于
浏览
1

我正在编写一个示例UWP程序,它使用EmguCV(一个用VB,C#,.NET等编写的程序的OpenCV包装器),看看我是否可以在UWP应用程序中使用它来处理我正在进行的项目 . 我正在使用Visual Studio 2017社区和EmguCV 3.3.0.2824,我下载了Windows安装程序并在带有Windows 10 Enterprise x64的Lenovo Thinkpad笔记本电脑上运行它 .

出于某种原因,当我尝试构建解决方案时,I get these two compiler errors in this photo.

用明文:

XamlCompiler错误WMC1006:无法解析程序集或Windows元数据文件'System.Windows.Forms.dll'

C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Community \ MSBuild \ Microsoft \ WindowsXaml \ v15.0 \ 8.2 \ Microsoft.Windows.UI.Xaml.Common.targets(354,5):Xaml内部错误错误WMC9999:类型Universe无法解析程序集:System.Windows.Forms,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089 .

Why do I have an Assembly conflict between Emgu.CV.UI and the UI namespace in the UWP API? What can I do to enable using both in my app?

This photo is what the Solution Explorer looks like.

在纯文本中:我创建了一个空白的UWP应用程序时,我拥有Visual Studio 2017生成的所有默认文件 . 另外,我有一个名为RTG_Demo_App.dll的文件,其中包含一些用C语言编写的使用OpenCV的代码 . 在References组中,我引用了Emgu.CV.UI和Emgu.CV.World .

我使用的默认代码App.xaml.cs以及MainPage.xaml.cs,除了我有以下几行:

using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.CV.UI;

在做了一些研究和实验之后,我发现的根本原因是对Emgu.CV.UI(Emgu.CV.UI.dll)的引用与UWP库中的UI命名空间之间的冲突 . 我无法删除对“通用Windows”库的引用,因为它是我需要的项目所需的UWP框架的一部分 .

我做过一些研究,除了我无法找到项目涉及EmguCV的资源,其中脚本直接用C#编写并为UWP而不是Visual C#或.NET构建 .

我在这里要完成的是一个使用OpenCV的项目,目标是UWP,脚本是C# . C#不支持OpenCV,所以我使用的是EmguCV .

请帮帮我 .

1 回答

  • 0

    System.Windows.Forms 不适用于UWP项目,因为它是User&GDI的包装器,它们都不能用于UWP .

    如果您只想在桌面上发布,则可以使用Desktop Bridge项目 .

相关问题