【发布时间】:2018-05-02 14:34:54
【问题描述】:
我正在我的 PC(带有 Visual Studio 2017 的 Windows)上尝试 .NET Google Cloud Speech API 示例的 QuickStart project,但我无法确定必须在哪里定义必须包含路径的 GOOGLE_APPLICATION_CREDENTIALS JSON 帐户密钥文件。
当我在 Visual Studio 2017 中运行项目时,它在此异常上失败:
System.InvalidOperationException: 'The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.'
我曾尝试在系统属性中定义GOOGLE_APPLICATION_CREDENTIALS 环境变量(在用户变量和系统变量下),如下所示:
C:\GCP_ApiKey\MyFirstProject-599bf9a10431.json
但它不起作用。
我在哪里定义GOOGLE_APPLICATION_CREDENTIALS?
【问题讨论】:
标签: windows google-cloud-platform environment-variables credentials google-speech-api