简体   繁体   English

VB中的Windows Azure存储:不在托管服务或开发结构中运行

[英]Windows Azure Storage in VB: Not running in a hosted service or the Development Fabric

I'm trying to run an instance of the Azure Blob Storage in the Azure Visual Studio 2010 development environment, but keep getting the following error: 我正在尝试在Azure Visual Studio 2010开发环境中运行Azure Blob存储的实例,但始终出现以下错误:

System.InvalidOperationException: Not running in a hosted service or the Development Fabric.

The stack trace is pointing to these lines: 堆栈跟踪指向以下行:

Imports Microsoft.WindowsAzure
Imports Microsoft.WindowsAzure.Diagnostics
Imports Microsoft.WindowsAzure.StorageClient

...

CloudStorageAccount.SetConfigurationSettingPublisher(Function(configName, configSetter) configSetter(ConfigurationManager.AppSettings(configName)))

Dim this_storage_account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString")

...

I'm a little dubious about the first line as it comes from ac# interpretor output of what appears to be a common hack to get around a quirk of the CloudStorageAccount class. 对于第一行,我有点怀疑,因为它来自ac#解释器输出,它似乎是解决CloudStorageAccount类的怪癖的常见技巧。

DataConnectionString is set to UseDevelopmentStorage=true DataConnectionString设置为UseDevelopmentStorage = true

Both the Development Fabric and Development Storage are running in the task bar. Development Fabric和Development Storage都在任务栏中运行。

I've tried creating a clean solution to see if this was a configuration issue, but am still getting the same error. 我尝试创建一个干净的解决方案,以查看这是否是配置问题,但仍然遇到相同的错误。

Any ideas gratefully received. 任何想法表示感谢。

This was extremely dense on my part. 就我而言,这非常密集。 I believe that it was because I was running the WebRole through the Visual Studio server, rather than the Development Fabric. 我相信这是因为我通过Visual Studio服务器而不是Development Fabric运行WebRole。 It therefore couldn't find the Storage service. 因此,它找不到存储服务。

For those that follow: 对于以下内容:

When viewing your WebRoles in the browser you should note that the functionality associated with Azure (beyond a simple web browser) will not be available unless you run them through the Debugger (F5). 在浏览器中查看WebRoles时,应注意与Azure关联的功能(简单的Web浏览器之外)将不可用,除非您通过调试器(F5)运行它们。

When I encountered this error message it was caused by an obsolete service deployment (from the previous day) that appears to have been shut down only partially - the newly started application had a different port number. 当我遇到此错误消息时,这是由于过时的服务部署(从前一天开始)引起的,似乎仅部分关闭了该服务-新启动的应用程序具有不同的端口号。 The application is in C#, but I'm quite sure it is not a language-related issue. 该应用程序使用C#,但是我很确定这不是与语言相关的问题。

Simply removing the old processes using the Compute Emulator UI or "csrun /devfabric:shutdown" fixes it. 只需使用Compute Emulator UI或“ csrun / devfabric:shutdown”删除旧进程即可对其进行修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM