The code will work on Windows and Linux.
It runs on .NET Core or .NET Standard. The only difference is that, if you wish to run on .NET Core, you should use project.json
. If you wish to run on .NET Standard, you should use packages.config
.
The API Client Library for Cloud Resource Manager API is available on nuget:
https://www.nuget.org/packages/Google.Apis.CloudResourceManager.v1/
The version as of writing is: 1.22.0.809
We'll do this 2 ways:
Windows
If you are using Visual Studio, create a new "Visual C#" "Console Application". Otherwise, create a directory for the project and create a file in it called packages.config
. packages.config is for .NET Standard but we're using .NET Standard with Windows. You may only run .NET Standard on Windows. Replace the contents of packages.config
with:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Apis" version="1.22.0"
targetFramework="net452" />
<package id="Google.Apis.Auth" version="1.22.0"
targetFramework="net452" />
<package id="Google.Apis.CloudResourceManager.v1" version="1.22.0.809"
targetFramework="net452" />
<package id="Google.Apis.Core" version="1.22.0"
targetFramework="net452" />
</packages>
Linux
Create a directory for the project and create a file in it called project.json
. project.json
is for .NET Core but we're using .NET Core with Linux in this example. You may run .NET Core on Linux or on Windows. Replace the contents of project.json
with:
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
},
"Google.Apis.CloudResourceManager.v1":"1.22.0.809"
},
"imports": "dnxcore50"
}
}
}