【问题标题】:Windows Azure The remote server returned an error: (404) Not FoundWindows Azure 远程服务器返回错误:(404) Not Found
【发布时间】:2016-11-02 20:01:31
【问题描述】:

我正在关注 this 教程,该教程是关于 Table Storage Service 的。我正在使用本教程的模拟器版本,您可以在“使用云服务时配置连接字符串”段落的第 5 点找到该教程。

这是我粘贴在“关于”ActionResult 中的代码:

public ActionResult About()
{

   // Retrieve the storage account from the connection string.
   CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
   CloudConfigurationManager.GetSetting("StorageConnectionString"));

   // Create the table client.
   CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

   // Create the CloudTable object that represents the "people" table.
       CloudTable table = tableClient.GetTableReference("people");

   // Create a new customer entity.
   CustomerEntity customer1 = new CustomerEntity("Harp", "Walter");
   customer1.Email = "Walter@contoso.com";
   customer1.PhoneNumber = "425-555-0101";

   // Create the TableOperation that inserts the customer entity.
   TableOperation insertOperation = TableOperation.Insert(customer1);

   // Execute the insert operation.
   table.Execute(insertOperation);

   return View();      
}

在这一行 table.Execute(insertOperation); 我收到以下错误消息:

StorageException 未被用户代码处理 远程服务器返回 错误:(404) 未找到。

我使用的项目模板是“Windows Azure 云服务”。弹出的下一个窗口,我只添加了“ASP.NET MVC 4 Web Role”。

有人知道是什么导致了这个错误吗?

【问题讨论】:

    标签: http-status-code-404 azure-storage azure-table-storage


    【解决方案1】:

    存储区中是否存在人员表? (您可以从 Azure 管理门户查看)

    【讨论】:

    • 嗨,是的,我好像忘了检查表是否存在。
    【解决方案2】:

    我在遇到同样的错误后来到这里(在 .replace 时未找到),但我的情况不同,我实际上有 people 表,但我的代码的问题是我正在更新 Row 键值。 我认为您只能更新其他字段,但不能更新分区键或行键。只是想将其添加到答案中,以防其他人遇到与我相同的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-20
      • 2018-04-17
      • 2014-01-19
      • 2019-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-01
      相关资源
      最近更新 更多