【发布时间】:2014-07-07 13:32:08
【问题描述】:
我需要通过 Azure 队列发送消息,并且需要使用 Windows Azure 模拟器对其进行测试,该模拟器表示运行正常。这些是我经历的步骤:
1- 运行 Windows Azure 存储模拟器(我尝试了 2.0.0 和 3.2.0 版本) 确保模拟器正在运行:
-
使用 Windows Azure Storage Emulator 2.0.0 时:
现在“已弃用”的 UI 显示所有三个存储模拟器都正常运行。 (我无法附上显示它的快照,因为我已经为 VisualStudio 2013 升级了 Windows Azure 存储 SDK 工具。
-
使用 Windows Azure Storage Emulator 3.2.0 时:
[这里是一个快照,显示它正在正确运行,但我没有添加 imgaes 的声誉:s]
2- 代码:
string azureStorageConnectionString = "UseDevelopmentStorage=true";
string queueName = "queuetest";
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString);
CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
_queue = queueClient.GetQueueReference(queueName);
_queue.CreateIfNotExists();
3- 每个 WAS Emulator 版本都有两个不同的问题。
-问题A:在线_queue.CreateIfNotExists();得到一个 uri not found 异常(404),因为它找不到队列,uri:127.0.0.1:10001/devstoreaccount1/queuetest
-问题 B:当我升级 WAS 模拟器时,异常消失了(所以升级是问题 A 的解决方案)但 Azure 存储资源管理器无法访问开发者存储帐户并给出以下信息留言:
Windows Azure Developer Storage is not runnign.
The process DSService.exe is not detected
因此,总而言之,我解决了问题 A,但现在 我无法使用 Azure 存储资源管理器访问 DevStorage 帐户。
【问题讨论】:
-
关于问题 B,它看起来像是特定于 Azure 存储资源管理器。在之前的 Storage Emulator 版本中,该服务的名称为
DSService.exe,在 3.0+ 版本中已更改为WAStorageEmulator.exe。请检查您是否可以使用 Visual Studio 连接到存储模拟器。 HTH。 -
这是一个很好的查看队列内容的替代方案(我之前尝试使用,但直到现在都无法使用)。所以,是的,我想我可以继续这样做。我会看看它是否与使用资源管理器相同,如果是,我将使用它:-D 非常感谢您的回答! :D
标签: windows azure storage emulation explorer