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

Heya :) #1

Open
Joelius300 opened this issue Mar 3, 2022 · 15 comments
Open

Heya :) #1

Joelius300 opened this issue Mar 3, 2022 · 15 comments

Comments

@Joelius300
Copy link
Collaborator

Joelius300 commented Mar 3, 2022

We could also switch to a different channel if you'd like but I thought this one should be pretty simple to use. With code markdown and whatnot.

@Joelius300
Copy link
Collaborator Author

Joelius300 commented Mar 3, 2022

I don't know if you've tried this but you can use sudo pacman -Syu to fully update your manjaro system. Then under "Manjaro Settings Manager" you can install 5.16 kernel. After that (and reboots) you can install .NET from the package manager and try if it works. You might need to uninstall the other .NET first but I believe you're running off a boot stick anyway right?

@PRIMETSS
Copy link
Owner

PRIMETSS commented Mar 4, 2022

Hi !

So installed fresh true install of Manjaro on laptop (stopped using USB boot as clunky)
Used Pacman to update system, and then from your advice above updated Kernal to Linux 5.16-2-MAJARO
As wiped, Used dotnet-install.sh to grab latest version of dotnet SDK ( 6.0.102 SDK) & Runtime (NETCore.App 6.0.2)
Copied that SerialPort_TestApp, deleted the bin folder to make sure building from scratch
cd'ed to project folder
Did
/root/.dotnet/dotnet restore (to get dependency packages)
/root/.dotnet/dotnet build (to build)
Check files outputted and checked version of System.IO.Ports.SerialPort.DLL (7.0.0-preview.1.22076) (click .dll file and open version.txt)
Plugged in USB Serial (lapotp top does not have SER port on MB)
Ran the Test App
/root/.dotnet/dotnet runtime_SerialPort_TestApp.dll

App enumerated the call to SerialPort.GetSerialPorts() list and found the port '/dev/ttyUSB0' and opened it successfully
IsOpen = [True]

Strange? Is this being run on a desktop/laptop? Or some IoT hardware>?
The App runs for you, but just reports # Serial Ports = 0 ? Do you have a USB Serial Port, like a Serial FDTI cable?
What time zone you in? I'm in Central Australia (GMT+10:30)

Cheers
Paul

@PRIMETSS
Copy link
Owner

PRIMETSS commented Mar 4, 2022

We could also switch to a different channel if you'd like but I thought this one should be pretty simple to use. With code markdown and whatnot.

OK for now I guess, but yeah if in similar time zones, live chat somehow might work better, Slack, Discord, or something.
I build a Manjaro laptop as above from scratch, not used Manjaro before so interesting to take a look (Was a hack laptop with Mint on it, as use Windows mainly for Dev) So be scracthy on the Linux side, but your obviously pretty comfy in Linux more than me.

Regards
Paul

@Joelius300
Copy link
Collaborator Author

Joelius300 commented Mar 4, 2022

What time zone you in?

I'm in central europe so GMT+1 😅 Might not be the easiest time zones for a live chat I assume.

I'm running on a desktop which has a PCI (actually not sure what exactly) serial port adapter installed. But the issue lies somewhere in compilation. I only get not-supported-shims which always throw, no matter what. This has to be because of platform detection issues or something like that, I never even get to actual code.

Maybe I can try to install .NET with the install script and see if that makes a difference. You've not tried the official dotnet packages from the manjaro repos right?

@PRIMETSS
Copy link
Owner

PRIMETSS commented Mar 4, 2022

No, always either download from MS download web site on Windows. And over last 6-8 months been using the script on Linux, as easy and seems to work.

"You've not tried the official dotnet packages from the manjaro repos right?"
Like from a Manjaro repo, using a Package Manager like PacMan? to download them?
No, never. Always go direct.

I'm stumped why your not able to build and run that Serial Test App.
Are you also pulling/forking & building the complete 'runtime' Repo of dotnet (core) and using that locally?

@Joelius300
Copy link
Collaborator Author

I'm using the dotnet-sdk, dotnet-host and dotnet-targeting-pack from the official manjaro repos, installed through pamac, the graphical interface for pacman.

I'm deinstalling these packages right now and installing via the script to see if it changes anything.

@PRIMETSS
Copy link
Owner

PRIMETSS commented Mar 4, 2022

OK Interesting! Give it a go.
What version are they?

dotnet --info
dotnet --version

@Joelius300
Copy link
Collaborator Author

Lol I actually can't believe it but it just works when reinstalling .NET with the installer script.. However, my IDE (rider) still shows me the shims with all throws (see below). But when I run it (even with version 6.0.0, not the 7.0.0 preview) it seems to work.

image

@PRIMETSS
Copy link
Owner

PRIMETSS commented Mar 4, 2022

Ok cool!? So it was just out of date dotnet? They do update it frequently
So you can now use Serial Ports?
Have you tried Visual Studio Code?

https://code.visualstudio.com/docs/setup/linux

@Joelius300
Copy link
Collaborator Author

I don't think it's the version that's the issue but the RID. I posted an update on the original issue.

I'll check vscode, just a sec.

@Joelius300
Copy link
Collaborator Author

Nope with Omnisharp and decompilation enabled I still get the throwing shims.

@PRIMETSS
Copy link
Owner

PRIMETSS commented Mar 5, 2022

Added some Platform reporting to program.cs
And rebuilt it on Laptop,

RID: [manjaro-x64]

@PRIMETSS
Copy link
Owner

PRIMETSS commented Mar 6, 2022

Hi hmmm Confused

So tried something out of interest, as not done this on Linux system before, only Windows.

So I cloned the DotNet runtime Repo (net#6) from MS's repo.
Setup a few prerequisites here to be able to build it. PreReqs, not all just cmake, etc (couldn't find what ever build-essentials package is & cant use the app-get script as diff package manager under arch
Build JUST the libraries
Build librarys
Copied the System.IO.Ports DLL and Native libSystem.IO.Ports.Native.so (appears to be lazy loaded by dll once run) from output to the previous test project and it ran. OK

So seems the project can build the System.IO.SerialPorts for Linux-64 and runs on Manjaro as is. Obviously all the build scripts that do all that switching in-out different stuff for building for Linux is working ok. But the problem you have seen seems to be a result of that being broken.

So Im confused. Ws it justa old version miss match and has been 'fixed' at some point since v5 say to now.
But your also mentioning thrid party IDE's etc? Which I'm not familiar with... I can imagine they, just like Visual Studio 2019/2022 which has often caused issues as they build the project out and use preview features even to make it work with dotnet (core)
But the 'native' CLI scripts have 9/10 always seem to work as expected.

I use VS2022 with dotnet 2/3/5/6 and building console apps, windows apps, aspnet apps (web apps) has always worked well as a IDE, consuming the dotnet framework. But building the actual CLR+Libraries + Cross-Platform is a challenge locally.
I'm sure their pipeline setup they use internally at MS is well maintained and shared/supported for their devs. But for us outside its more difficult (I am surprised it can be done at all considering the complexity)

Cheers
Paul

@PRIMETSS
Copy link
Owner

PRIMETSS commented Mar 8, 2022

Just out of interest
Installed Ubuntu, updated, installed DotNet 6.0.120 SDK from "Ubuntu Software"/Store install
And got same results you had previously with Manjaro, with SerialPort test app
"SerialPort only supported on Windows"
Runtime [6.0.2]

Ran dotnet-install.sh [SDK 6.0.102]
Got same exception error!
Rebooted
Ran app again: Got same exception error!
Deleted and dotnet Rebuild app
Ran app again: Got same exception error!

Modified (Was not forcing versioning before)
Rebuilt
Ran app again: Worked and opened serial port successfully.

So def got fixed from 6 to 7-preview1

And believe it actually got fixed starting here #30903

@Joelius300
Copy link
Collaborator Author

Joelius300 commented Mar 8, 2022

See comment in the other repo.

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