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