VB 中的 Windows Azure 存储:未在托管服务或 Development Fabric 中运行

发布于 2024-09-18 01:17:21 字数 882 浏览 7 评论 0原文

我尝试在 Azure Visual Studio 2010 开发环境中运行 Azure Blob 存储的实例,但不断收到以下错误:

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

堆栈跟踪指向这些行:

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")

...

我对第一行有点怀疑,因为它来自 ac# 解释器的输出,该输出似乎是一个常见的 hack,用于解决 CloudStorageAccount 类的一个怪癖。

DataConnectionString 设置为 UseDevelopmentStorage=true

Development Fabric 和 Development Storage 都在任务栏中运行。

我尝试创建一个干净的解决方案来查看这是否是配置问题,但仍然遇到相同的错误。

任何想法都感激不尽。

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:

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 a c# interpretor output of what appears to be a common hack to get around a quirk of the CloudStorageAccount class.

DataConnectionString is set to UseDevelopmentStorage=true

Both the Development Fabric and Development Storage are running in the task bar.

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

耶耶耶 2024-09-25 01:17:21

这对我来说非常密集。我相信这是因为我是通过 Visual Studio 服务器而不是 Development Fabric 运行 WebRole。因此它找不到存储服务。

对于以下内容:

在浏览器中查看 WebRoles 时,您应该注意,与 Azure 关联的功能(除了简单的 Web 浏览器之外)将不可用,除非您通过调试器 (F5) 运行它们。

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. 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).

姜生凉生 2024-09-25 01:17:21

当我遇到此错误消息时,这是由过时的服务部署(前一天开始)引起的,该服务部署似乎仅部分关闭 - 新启动的应用程序具有不同的端口号。该应用程序是用 C# 编写的,但我很确定这不是与语言相关的问题。

只需使用计算模拟器 UI 或“csrun /devfabric:shutdown”删除旧进程即可修复此问题。

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.

Simply removing the old processes using the Compute Emulator UI or "csrun /devfabric:shutdown" fixes it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文