【发布时间】:2017-09-27 18:03:47
【问题描述】:
我一直在尝试用 c# 从 Google Cloud SQL 查询数据库。但是,我无法让它工作。
我按照谷歌参考页面https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/databases/get 并尝试做一个简单的事情,例如首先获取数据库列表。
在我的.csproj 文件中,我已经导入了几个api。
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Apis.Auth"/>
<PackageReference Include="Google.Apis.SQLAdmin.v1beta4"/>
<PackageReference Include="Google.Apis"/>
<PackageReference Include='Google.Cloud.Iam.V1' version="1.0.0-beta12" />
<PackageReference Include="Google.Apis.Core" version="1.28.0" />
</ItemGroup>
</Project>
另外,我参考了 Github 存储库并找到了使用 BigQuery、PubSub 等但没有使用 Cloud SQL 的示例。 https://github.com/GoogleCloudPlatform/dotnet-docs-samples
有人可以给我一些建议或指出正确的方向吗?
非常感谢。
【问题讨论】:
标签: google-api google-cloud-sql google-api-client google-api-dotnet-client google-client