views:

40

answers:

1

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.

A: 

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

notreadbyhumans