简体   繁体   English

哪个 nuget 包包含方法 GetSheetService()?

[英]Which nuget package contains the method GetSheetService()?

I want to know whether there is a nuget package that contains GetSheetService(), I can't find which is the right package, anyone know this?我想知道是否有包含 GetSheetService() 的 nuget 包,我找不到哪个是正确的包,有人知道吗? Has anyone used this method?有人用过这个方法吗?

This are the packages that I had installed:这是我安装的软件包:

  <ItemGroup>
    <PackageReference Include="Google.Apis" Version="1.40.3" />
    <PackageReference Include="Google.Apis.Auth" Version="1.40.3" />
    <PackageReference Include="Google.Apis.Auth.Mvc" Version="1.40.3" />
    <PackageReference Include="Google.Apis.Sheets.v4" Version="1.40.3.1694" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.28" />
  </ItemGroup>

and this is the problem I have encountered:这是我遇到的问题: 在此处输入图片说明

this is the start of the cs file:这是cs文件的开始:

using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Google.Apis.Sheets.v4;

The google .net client library does not have a method called get sheets service. google .net 客户端库没有称为 get sheet 服务的方法。 I suspect you are copying this from someones code some places.我怀疑你是从某些地方的某人代码中复制的。 The correct way to create a sheets service follows创建sheet服务的正确方法如下

/// <summary>
    /// This method get a valid service
    /// </summary>
    /// <param name="credential">Authecated user credentail</param>
    /// <returns>SheetsService used to make requests against the Sheets API</returns>
    private static SheetsService GetService(UserCredential credential)
    {
        try
        {
            if (credential == null)
                throw new ArgumentNullException("credential");

            // Create Sheets API service.
            return new SheetsService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName = "Sheets Oauth2 Authentication Sample"
            });
        }
        catch (Exception ex)
        {
            throw new Exception("Get Sheets service failed.", ex);
        }
    }
}

Code ripped from my google .net client Library sample project.从我的 google .net 客户端库示例项目中提取的代码。 Oauth2Authentication.cs) Oauth2Authentication.cs)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么下载Nuget软件包会出现错误“软件包包含不安全提取的条目”,为什么? - Downloading a Nuget package is giving the error “Package contains an entry which is unsafe for extraction” why? 什么NuGet包包含DotNet Core的OptimisticConcurrencyException? - What NuGet package contains OptimisticConcurrencyException for DotNet Core? 是否有包含 Dapper.Net SqlBuilder 的 nuget 包? - Is there a nuget package that contains Dapper.Net SqlBuilder? 如何找到包含程序集的nuget包? - How to find the nuget package that contains an assembly? 哪个nuget软件包在Nuget中包含Microsoft.WindowsAzure.StorageClient.dll - Which nuget package holds the Microsoft.WindowsAzure.StorageClient.dll in Nuget 命名空间Microsoft.TeamFoundation.Framework.Server的哪个nuGet包 - Which nuGet package for namespace Microsoft.TeamFoundation.Framework.Server 有没有办法确定 NuGet 包针对的是哪个版本的 .Netstandard? - Is there a way to determine which version of .Netstandard is targeted by a NuGet package? Elasticsearch 1.x应该使用哪个版本的NEST NuGet包? - Which version of NEST NuGet package should be used with Elasticsearch 1.x? Azure 函数输入绑定:“表”属性的哪个 NuGet 包? - Azure function input binding: Which NuGet package for "Table" attribute? 使用 Nuget package 的 ProjectReference 在构建时不包括在内 - ProjectReference which consumes a Nuget package isn't included when building
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM