Platform not supported exception if using PowerShell Import-Module
See original GitHub issueI have a C# DLL that has the System.Device.Gpio Version="1.0.0"
and I want to use it with PowerShell, through Import-Module. Upon importing the DLL, if I try to create an I2cConnectSettings object, I get an exception saying that Operation is not supported on this platform
.
On the same project, I’ve created the Main method that does exactly the same. If I run dotnet donetIot_test.dll
the code runs successfully.
I can’t seem to find the root cause of the exception, but the platform is the same (raspberry pi 3b) - assuming that the platform is the hardware.
If I run the dotnet donetIot_test.dll
command inside PowerShell it works, so it doesn’t seem to be shell-related.
Here’s a link to the repo with a sample
Versions used
Add following information:
dotnet --info on the machine being used to build
.NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.13-x64 Base Path: /usr/local/share/dotnet/sdk/3.0.100/
Host (useful for support): Version: 3.0.0 Commit: 7d57652f33
.NET Core SDKs installed: 2.1.202 [/usr/local/share/dotnet/sdk] 2.1.700 [/usr/local/share/dotnet/sdk] 2.2.107 [/usr/local/share/dotnet/sdk] 3.0.100 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
dotnet --info on the machine where app is being run (not applicable for self-contained apps)
pi@raspberrypi:~/PowerShell_IoT/publish $ dotnet --info It was not possible to find any installed .NET Core SDKs Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from: https://aka.ms/dotnet-downloadHost (useful for support): Version: 3.0.0 Commit: 7d57652f33
.NET Core SDKs installed: No SDKs were found.
.NET Core runtimes installed: Microsoft.AspNetCore.App 3.0.0 [/home/pi/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.0.0 [/home/pi/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
- Version of
System.Device.Gpio
package: 1.0.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Yes! That was exactly the problem! Since I saw the
runtimes
inside the publish folder, I didn’t even try to compile with the Linux as runtime.Closing as the issue seems to be resolved.