私はマイクロソフトトランスレータを使用しようとしていますし、私はLanguageServiceClient
を作成しようとしていますたびに私はエラーを取得します。マイクロソフトトランスレータエラー
try
{
// Add the http header
string headerValue = GetAccessToken();
HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty();
httpRequestProperty.Method = "POST";
httpRequestProperty.Headers.Add("Authorization", headerValue);
TranslatorService.LanguageServiceClient client = new TranslatorService.LanguageServiceClient();
using (OperationContextScope scope = new OperationContextScope(client.InnerChannel))
{
OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;
result = client.Detect("", textToTranslate);
}
}
catch (Exception ex)
{
result = "Error: " + ex.Message;
}
エラー:
Could not find default endpoint element that references contract 'TranslatorService.LanguageService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
任意の提案ですか?
は、私はあなたがすでに_チェックしようとしたと仮定し、「何の設定ファイルは、アプリケーションのために見つからなかったため、またはこの契約に一致するエンドポイント要素は、クライアントの要素で見つけることができなかったので、これは可能性がありますか。」_? –
ええおかげで私はあなたが常に答えに許可されている私は、ウェブサイトの設定ファイル「web.configファイル」に追加しようとしたその今働いおかげで –
を@StevenJeuris変換ロジック を行うクラスライブラリでサービス設定を入れていたエラーを発見しましたあなた自身の質問で、これは「開かれた」ままではありません。 –