Skip to content

System.UnauthorizedAccessException" in mscorlib.dll #10

@RollingStone1989

Description

@RollingStone1989

Hello!

OS: Windows 7

VB.NET always gives me an error message like written in title, when running test application and clicking the Button1:

`
Imports PiSharp.LibGpio
Imports PiSharp.LibGpio.Entities

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    LibGpio.Gpio.SetupChannel(BroadcomPinNumber.Four, Direction.Output)
    LibGpio.Gpio.SetupChannel(BroadcomPinNumber.Eighteen, Direction.Input)
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    LibGpio.Gpio.OutputValue(BroadcomPinNumber.Four, True)
End Sub

End Class
`

It denies the access to the path written in the "LibGpio.cs" unter GetGpioPath() in line 470:

private string GetGpioPath() { if (Environment.OSVersion.Platform == PlatformID.Win32NT || Environment.OSVersion.Platform == PlatformID.Win32Windows || Environment.OSVersion.Platform == PlatformID.Win32S || Environment.OSVersion.Platform == PlatformID.WinCE) { // If we're running under Windows, use a Windows format test path return "C:\\RasPiGpioTest"; } }

Doesn't matter which path i'm filling in there (i tried different paths in my user directory or on another hard disk): the error rests. I tried to run the application as administrator and from the compiled .exe. It doesn't work.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions