【问题标题】:error CS0234: The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)错误 CS0234:命名空间“Microsoft”中不存在类型或命名空间名称“Azure”(是否缺少程序集引用?)
【发布时间】:2020-03-31 20:02:34
【问题描述】:

我已经在 Visual Studio 中安装了 Microsoft.azure.data nuget 包,但我遇到了以下错误 - Program.cs(1,17):错误 CS0234:命名空间“Microsoft”中不存在类型或命名空间名称“Azure”(您是否缺少程序集引用?)下面是我的程序代码 -

using Microsoft.Azure.Kusto.Data;
using System;
namespace LensDashboradOptimization
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            //var clusterUrl = "https://mykusto.kusto.windows.net";

            // replace 'WithAadUserPromptAuthentication' with your preferred method of authentication
            //var kcsb = new Kusto.Data.KustoConnectionStringBuilder(clusterUrl); 


            //Console.WriteLine(kcsb);
            // Read the first row from reader -- it's 0'th column is the count of records in MyTable
            // Don't forget to dispose of reader when done.

            var client = Kusto.Data.Net.Client.KustoClientFactory.CreateCslQueryProvider("https://help.kusto.windows.net/Samples;Fed=true");
            var reader = client.ExecuteQuery("StormEvents | count");
            Console.WriteLine(reader);
        }
    }
}

【问题讨论】:

    标签: c# azure azure-data-explorer


    【解决方案1】:

    安装 Microsoft.Azure.Kusto.Data nuget。然后它为我编译。它确实给了我身份验证错误,但不是程序集引用错误。

    
    using Kusto.Data.Net.Client;
    
    namespace ConsoleApp2
    {
        class Program
        {
    
    
            static void Main(string[] args)
            {
    
                var client = KustoClientFactory.CreateCslQueryProvider("https://help.kusto.windows.net/Samples");
                var reader = client.ExecuteQuery("StormEvents | count");
            }
        }
    }
    

    【讨论】:

    • 我不确定,您必须阅读 Kusto 客户端身份验证。我希望你已经加载了程序集。如果回答了您的问题,请将帖子标记为已回答
    猜你喜欢
    • 2017-05-01
    • 2020-12-17
    • 1970-01-01
    • 2019-06-26
    • 2021-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-15
    相关资源
    最近更新 更多