在 Azure 计算 UI 中,为什么 Trace.WriteLine 不转到辅助角色的控制台窗口?2.2 软件开发工具包



我似乎无法将任何输出消息发送到Azure Compute Emulator中任何工作角色的控制台窗口。我正在运行Azure SDK 2.2,我从模板中创建了一个新的Worker角色,没有任何内容打印到控制台窗口。我看到的唯一信息是关于面料的。

[fabric] Role Instance: deployment22(58).WindowsAzure2.TestWorkerRole.0
[fabric] Role state Started

我试过Console.WriteLine和Trace.WriteLine,但都不起作用。

using System.Linq;
using System.Net;
using System.Threading;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Diagnostics;
using Microsoft.WindowsAzure.ServiceRuntime;
using Microsoft.WindowsAzure.Storage;
namespace TestWorkerRole
{
    public class WorkerRole : RoleEntryPoint
    {
        public override void Run()
        {
            // This is a sample worker implementation. Replace with your logic.
            Trace.TraceInformation("TestWorkerRole entry point called", "Information");
            Console.WriteLine("Hello World");
            while (true)
            {
                Thread.Sleep(10000);
                Trace.TraceInformation("Working", "Information");
                Console.WriteLine("Inside loop");
            }
        }
        public override bool OnStart()
        {
            // Set the maximum number of concurrent connections 
            ServicePointManager.DefaultConnectionLimit = 12;
            // For information on handling configuration changes
            // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.
            return base.OnStart();
        }
    }
} 

事实证明,在安装Azure 2.2 SDK后,我不得不重新启动计算机。

最新更新