title: inaccessible due to its protection level error in a code from a Microsoft Tutorial
body: <p>The following code from an <a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/quickstarts/csharp" rel="nofollow noreferrer">Official Microsoft Azure tutorial</a> is giving the following error message at the first line:</p>
  
  <pre><code>ITextAnalyticsAPI client = new TextAnalyticsAPI();
  </code></pre>
  
  <blockquote>
    <p><code>TextAnalyticsAPI.TextAnalyticsAPI(param DelegatingHandler[])</code>  is inaccessible due to its protection level</p>
  </blockquote>
  
  <pre><code>using System;
  using Microsoft.Azure.CognitiveServices.Language.TextAnalytics;
  using Microsoft.Azure.CognitiveServices.Language.TextAnalytics.Models;
  using System.Collections.Generic;
  
  namespace ConsoleApp1
  {
      class Program
      {
          static void Main(string[] args)
          {
              // Create a client.
              ITextAnalyticsAPI client = new TextAnalyticsAPI();
              client.AzureRegion = AzureRegions.Westus;
              client.SubscriptionKey = "ENTER KEY HERE";
  
              Console.OutputEncoding = System.Text.Encoding.UTF8;
  
              // Extracting language
              Console.WriteLine("===== LANGUAGE EXTRACTION ======");
  
              LanguageBatchResult result = client.DetectLanguage(
                      new BatchInput(
                          new List&lt;Input&gt;()
                          {
                            new Input("1", "This is a document written in English."),
                            new Input("2", "Este es un document escrito en Español."),
                            new Input("3", "这是一个用中文写的文件")
                          }));
  
              // Printing language results.
              foreach (var document in result.Documents)
              {
                  Console.WriteLine("Document ID: {0} , Language: {1}", document.Id, document.DetectedLanguages[0].Name);
              }
  
              // Getting key-phrases
              Console.WriteLine("\n\n===== KEY-PHRASE EXTRACTION ======");
  
              KeyPhraseBatchResult result2 = client.KeyPhrases(
                      new MultiLanguageBatchInput(
                          new List&lt;MultiLanguageInput&gt;()
                          {
                            new MultiLanguageInput("ja", "1", "猫は幸せ"),
                            new MultiLanguageInput("de", "2", "Fahrt nach Stuttgart und dann zum Hotel zu Fu."),
                            new MultiLanguageInput("en", "3", "My cat is stiff as a rock."),
                            new MultiLanguageInput("es", "4", "A mi me encanta el fútbol!")
                          }));
  
  
              // Printing keyphrases
              foreach (var document in result2.Documents)
              {
                  Console.WriteLine("Document ID: {0} ", document.Id);
  
                  Console.WriteLine("\t Key phrases:");
  
                  foreach (string keyphrase in document.KeyPhrases)
                  {
                      Console.WriteLine("\t\t" + keyphrase);
                  }
              }
  
              // Extracting sentiment
              Console.WriteLine("\n\n===== SENTIMENT ANALYSIS ======");
  
              SentimentBatchResult result3 = client.Sentiment(
                      new MultiLanguageBatchInput(
                          new List&lt;MultiLanguageInput&gt;()
                          {
                            new MultiLanguageInput("en", "0", "I had the best day of my life."),
                            new MultiLanguageInput("en", "1", "This was a waste of my time. The speaker put me to sleep."),
                            new MultiLanguageInput("es", "2", "No tengo dinero ni nada que dar..."),
                            new MultiLanguageInput("it", "3", "L'hotel veneziano era meraviglioso. È un bellissimo pezzo di architettura."),
                          }));
  
  
              // Printing sentiment results
              foreach (var document in result3.Documents)
              {
                  Console.WriteLine("Document ID: {0} , Sentiment Score: {1:0.00}", document.Id, document.Score);
              }
  
          }
      }
  }
  </code></pre>