按照本文(https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-how-to-use-dotnet)中的步骤创建,我创建一个控制台应用程序,并添加以下代码的主要方法:错误天青表使用C#
string connection = "DefaultEndpointsProtocol=https;AccountName=MyStorageAccountName;AccountKey=MyAccountKey;EndpointSuffix=core.windows.net";
CloudStorageAccount account;
if (!CloudStorageAccount.TryParse(connection, out account))
{
throw new Exception("Unable to parse storage account connection string.");
}
CloudTableClient tableClient = account.CreateCloudTableClient();
CloudTable table = tableClient.GetTableReference("mytable");
// this is the line at which I get the error:
table.CreateIfNotExists();
然而,我上执行时有以下错误最后一行:
无法加载文件或程序集“Microsoft.Data.OData,版本= 5.6.2.0,文化=中性公钥= 31bf3856ad364e35”或它的一个依赖。定位的程序集清单定义与程序集引用不匹配。 (异常来自HRESULT:0x80131040)
任何想法,为什么我得到这个错误?
注:我写了类似的代码,目标是相同的存储帐户,但创建一个队列,它工作正常。