MVVMCROSS的串行端口(.NET标准库)
我正在开发用于实现串行接口的WPF应用程序。我正在使用 mvvmcross 框架实现MVVM结构。 MVVMCross在解决方案中使用两个项目,一个是 .NET类库,,另一个是WPF项目。
.NET类库(.NET标准2.0)中存在模型和ViewModels。该标准中不存在串行端口类,但是有一个system.io.ports nuget软件包用于使用串行端口。
我的问题从这里开始,我正在尝试使用此Nuget软件包,但是每当我使用SerialPort类时,应用都会抛出System.io.filenotfoundexception。在输出中说(mvxbeginner.core是项目名称):
异常投掷:'system.io.filenotfoundexception'in mvxbeginner.core.dll
MvxBeginner.core.dll中发生的类型“ System..io.io.filenotfoundexception”的例外。
我不确定是否与此例外有关。使用.NET标准或MVVMCross。如果有人有任何想法,我将非常感谢。
I'm developing a WPF application for implementing a serial interface. I am implementing MVVM structure using MVVMCross framework. MVVMCross uses two projects in a solution, one is the core application that is a .NET class library, and the other is the WPF project.
Models and viewmodels exist in the .NET class library (.NET Standard 2.0). Serial port class does not exist in this standard but there is a System.IO.Ports nuget package to use serial ports.
My problem begins here, i am trying to use this nuget package but whenever i use serialport class, app throws an System.IO.FileNotFoundException. In the output it says (MvxBeginner.Core is the project name):
Exception thrown: 'System.IO.FileNotFoundException' in MvxBeginner.Core.dll
An exception of type 'System.IO.FileNotFoundException' occurred in MvxBeginner.Core.dll but was not handled in user code
I am not sure if this exception is related with .net standard or with MVVMCross. If anyone have any ideas i would really appreciate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我试图解决这个问题一天。当我在WPF项目中添加Nuget软件包时,就解决了问题。在此之前,我仅在核心项目上安装了Nuget软件包。
Well, i tried to solve this problem for a day. Problem is solved when i added the nuget package to WPF project as well. Before that i installed nuget package only to the core project.