无法将Systemioports.serialport_mono用于vb.net应用
我的VB.NET应用程序正在使用.NET Framework 4.6
我从 https://github.com/michaldobrodenka/system.io.ports.mono
然后,该应用在加载时致电GetPortNames时崩溃:
system.io.filenotfoundException Hresult = 0x80070002 消息=无法加载文件或汇编'Microsoft.win32.Registry,版本= 4.1.3.0,Culture = Neutral,publicKeyToken = B03F5F7F11D50A3A'或其依赖项之一。该系统找不到指定的文件。 source = system.io.ports.mono StackTrace: 在C:\ dotnet2019 \ spectrosavevb \ system.io.ports.mono-master \ system.io.portsplus \ serialport.cs:system..io.portsplus.serialport.getPortNames() 在c:\ dotnet2019 \ spectrosavevb \ system.io.ports.mono-master \ system.io.portsplus \ serialport.cs:system..io.portsplus.serialport.getDefaultPortName()中 在c:\ dotnet2019 \ spectrosavevb \ system.io.ports.mono-master \ system.io.portsplus \ systersplus \ Serialplus \ SerialPort.cs:633313 在c:\ dotnet2019 \ spectrosavevb \ system.io.ports.mono-master \ system.io.portsplus \ portsplus \ serialport.cs:system..io.portsplus.serialport..ctor..ctor(icontainer容器)中 在c:\ dotnet2019 \ spectrosavevb \ spectrosave.designer.vb:c:\ dotnet2019 在c:\ dotnet2019 \ spectrosavevb \ spectrosave.vb:line 36
My vb.net app is using .net framework 4.6
I replaced System.IO.Ports with System.IO.Ports.Mono (for netstandard 2.0) from https://github.com/michaldobrodenka/System.IO.Ports.Mono
Then the app is crashing when calling GetPortNames at loading :
System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'Microsoft.Win32.Registry, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Source=System.IO.Ports.Mono
StackTrace:
at System.IO.PortsPlus.SerialPort.GetPortNames() in C:\dotnet2019\SpectroSaveVb\System.IO.Ports.Mono-master\System.IO.PortsPlus\SerialPort.cs:line 563
at System.IO.PortsPlus.SerialPort.GetDefaultPortName() in C:\dotnet2019\SpectroSaveVb\System.IO.Ports.Mono-master\System.IO.PortsPlus\SerialPort.cs:line 103
at System.IO.PortsPlus.SerialPort..ctor() in C:\dotnet2019\SpectroSaveVb\System.IO.Ports.Mono-master\System.IO.PortsPlus\SerialPort.cs:line 63
at System.IO.PortsPlus.SerialPort..ctor(IContainer container) in C:\dotnet2019\SpectroSaveVb\System.IO.Ports.Mono-master\System.IO.PortsPlus\SerialPort.cs:line 67
at SpectroSave.SpectroSave.InitializeComponent() in C:\dotnet2019\SpectroSaveVb\SpectroSave.Designer.vb:line 58
at SpectroSave.SpectroSave..ctor() in C:\dotnet2019\SpectroSaveVb\SpectroSave.vb:line 36
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论