1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Azure; // Namespace for CloudConfigurationManager
using Microsoft.WindowsAzure.Storage; // Namespace for CloudStorageAccount
using Microsoft.WindowsAzure.Storage.Table; // Namespace for Table storage types
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
try
{
// Retrieve the storage account from the connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString"));
// Create the table client.
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
// Retrieve a reference to the table.
CloudTable table = tableClient.GetTableReference("Demo");
// Create the table if it doesn't exist.
table.CreateIfNotExists();
Console.WriteLine("Succ");
}
catch (Exception ex)
{
Console.WriteLine(ex);
Console.ReadKey();
}
}
}
}
我們正試圖在Visual Studio 2015中運行此代碼。我們在創建Azure存儲模擬器中的表時遇到錯誤。無法在Azure存儲模擬器中創建表
您是否在運行Storage Emulator? – juunas
請確保存儲模擬器正在運行。根據錯誤,仿真器似乎沒有在您的機器上運行。 –