gpt4 book ai didi

azure - 无法在 Azure 存储模拟器中创建表

转载 作者:行者123 更新时间:2023-12-03 03:08:51 24 4
gpt4 key购买 nike

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 存储模拟器中创建表时出现错误。

Getting this error while executing above code..

最佳答案

Azure 存储模拟器似乎未运行。请确保您已按照描述启动它 here .

基本上,您需要在程序中搜索“Windows Azure Storage Emulator”并启动它。应打开一个控制台窗口,您可以在其中控制模拟器。

请告诉我这是否有帮助。

关于azure - 无法在 Azure 存储模拟器中创建表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41565478/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com