.NETCore应用程序因StackOverflowException而终止

Mar*_*ker 3 c# exception raspberry-pi .net-core

所以,

我正在使用Raspberry Pi模型3b,我已成功运行.NetCore v2.0.1.我已经能够建立CoreIOT Hello World项目并运行它不会对我的皮的问题,现在我有我也有使用GPIO董事会和我能想到的.NETCore使用它的唯一的方式创造了一些定制的硬件是使用文件系统方法/sys/class/gpio我已经构建了一个非常小的应用程序

https://github.com/barkermn01/CanReader

没有多少,但由于某种原因,当我运行应用程序我得到的是一条消息说Proccess is terminating due to StackOverflowException我不知道是什么导致它没有什么在那里太大我不认为只是基本的文件系统阅读.

我唯一能想到的是它不喜欢无限循环

来自:https://github.com/barkermn01/CanReader/blob/master/Program.cs

while (!exiting)
{
    Console.Write("\rCurrent State " + state);
    string input = Console.ReadLine();
    if (input == "exit")
    {
        watcher.Stop();
        exiting = true;
    }
}
Run Code Online (Sandbox Code Playgroud)

和来自:https://github.com/barkermn01/CanReader/blob/master/GPIOWatcher.cs

public void watch()
{
    GPIO.Value val = Gpio.ReadValue();
    while (val != OldValue)
    {
        val = Gpio.ReadValue();
        if (Delegate != null)
        {
            Delegate.DynamicInvoke();
        }
        Thread.Sleep(10);
    }
}
Run Code Online (Sandbox Code Playgroud)

Wae*_*her 10

检查属性getterGPIO.FullPath访问自己:

   /// <summary>
    /// Generates the full path for the Filesystem mappings for this GPIO pin
    /// </summary>
    public string FullPath
    {
        get
        {
            return this.Path + "/" + this.FullPath;
        }
    }
Run Code Online (Sandbox Code Playgroud)