简体   繁体   English

没有从Azure存储包中获取所有方法

[英]Not getting all the methods from Azure Storage package

So I'm trying to play around with Queues in Azure storage so I created a Console application and added the WindowsAzure.Storage package in NuGet. 因此,我尝试使用Azure存储中的队列,因此创建了一个控制台应用程序,并在NuGet中添加了WindowsAzure.Storage程序包。 Then I put this bit of code in and it works it creates a queue for me. 然后,我将这段代码放入其中,并且它可以为我创建一个队列。

    static void Main(string[] args)
    {
        string connection = "myConnectionString......";
        CloudStorageAccount storageAcc = CloudStorageAccount.Parse(connection);

        CloudQueueClient queueClient = storageAcc.CreateCloudQueueClient();
        CloudQueue queue = queueClient.GetQueueReference("myQueue");
        queue.CreateIfNotExistsAsync();
        Console.ReadKey();
    }

However there should be a non Async version I can call instead 但是应该有一个我可以调用的非异步版本

        queue.CreateIfNotExists();

But Visual Studio 2017 is not recognising CreateIfNotExists as a member of CloudQueue. 但是Visual Studio 2017无法将CreateIfNotExists识别为CloudQueue的成员。

If I try to build it it throws a compile error. 如果我尝试构建它,则会引发编译错误。

I seems like lots of non Async methods are missing such as AddMessage and GetMessage any idea what could cause this? 我似乎好像缺少许多非异步方法,例如AddMessage和GetMessage,不知道是什么原因引起的?

I seems like lots of non Async methods are missing such as AddMessage and GetMessage any idea what could cause this? 我似乎好像缺少许多非异步方法,例如AddMessage和GetMessage,不知道是什么原因引起的?

According to your description, I suppose you created a Console .NET Core project. 根据您的描述,我想您创建了一个Console .NET Core项目。 I have created a simple demo, the result like this . 我创建了一个简单的演示,结果像这样 This .NET Core project just supports the Async methods.There is no these sync methods now. 该.NET Core项目仅支持Async方法。目前没有这些同步方法。 So you haven't missed these methods. 因此,您不会错过这些方法。

If you just want to use sync methods like queue.CreateIfNotExists(), I suggest you could choose Console App(.NET Framework) project and install the WindowsAzure.Storage package to try again. 如果只想使用queue.CreateIfNotExists()之类的同步方法,建议您选择Console App(.NET Framework)项目并安装WindowsAzure.Storage程序包,然后重试。 Or you could refer to this article to use Azure queue. 或者,您可以参考本文以使用Azure队列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM