Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when i use System.IO.Ports #27

Open
allucche opened this issue Feb 18, 2020 · 2 comments
Open

Exception when i use System.IO.Ports #27

allucche opened this issue Feb 18, 2020 · 2 comments

Comments

@allucche
Copy link

Great development environment !!
i have a problem with SerialPort class. I use serialport to communicate with Arduino Mega

NET CORE doesn't support this class so I used this:
https://www.nuget.org/packages/System.IO.Ports/4.7.0

When execute plugin in Enable() i have:
Inner Exception:
PlatformNotSupportedException: System.IO.Ports is currently only supported on Windows.
Stack:
.........

is there any way to make it work? even just under WINDOWS
Thank you!

@jaurenq
Copy link
Collaborator

jaurenq commented Feb 21, 2020

Hi allucche,

I have successfully used that very package on Windows. The error you included there looks like you're not on Windows; see where it says "is currently only supported on Windows". What platform are you on?

@jaurenq
Copy link
Collaborator

jaurenq commented Feb 27, 2020

@allucche , I dug out my old System.IO.Ports-using code and I now get the same error you're seeing. I did some Googling and it looks like MS may have actually just published a broken package.

dotnet/runtime#25375

I worked around the problem by publishing the project and then digging down into runtimes\win\lib\netstandard2.0 and copying System.IO.Ports.dll and Microsoft.Win32.Registry.dll from there up to the root plugin directory, overwriting the copies of those two DLLs that were put there by the publish command. Have to redo that after every time running the publish command.

I also downgraded from System.IO.Ports 4.7 to 4.5, but I'm not sure if the downgrade was actually necessary to fix the problem.

Hopefully MS will fix their package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants