.net - Netduino no "Console.WriteLine",控制台在当前上下文中不存在

标签 .net .net-micro-framework netduino

我似乎无法将非常简单的 netduino 程序写入调试控制台; VS 抛出错误

The name 'Console' does not exist in the current context

有什么想法可能会导致它不存在吗?

using System;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.NetduinoPlus;

namespace LumenReader
{
public class Program
{
    public static void Main()
    {

        AnalogInput photoResistor = new AnalogInput(Pins.GPIO_PIN_A0);
        int photoVolt;
        while (true)
        {
            photoVolt = photoResistor.Read();
            Console.WriteLine(photoVolt);
        }

    }

}
}

编辑

Debug.Print 有效

最佳答案

嵌入式设备上没有控制台。因此,正如您所发现的,您必须使用 Debug.Print。

关于.net - Netduino no "Console.WriteLine",控制台在当前上下文中不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14250645/

相关文章:

profiler - 是否有在 .NET Micro Framework 上运行的分析器?

appharbor - netduino 板可以直接向我的 appharbor 应用程序发送和接收数据吗?

c# - 并发下的 Queue<T> 为不同的类型提供不同的结果

c# - 打印Pdf文档C#字体生成的Barcode

c#-3.0 - C# 为什么不能将 UInt32 拆箱为 UInt64?

c - 使用 NETMF 的 SPI 主机到 PIC18F4550 从机同步 (C18)

.net - CInt 在 .Net MF 中没有按预期工作

C#直接赋值给对象引用

.net - System.ServiceModel、可移植类库和代码分析