c# - Microsoft.Graph.Beta.dll 缺少 IPrintDocumentRequestBuilder.Content() 尽管 MS Graph Explorer 代码片段提示它?
问题描述
MS Graph Explorer显示您输入的 HTTP 请求的 C# 代码片段(这是一个可爱的功能)。
我输入的 http 请求是(我用 {ID} 替换了我的 GUID): https://graph.microsoft.com/beta/print/printers/{printerID}/jobs/{jobID}/documents/{documentID} /$值
这是使用 Beta/Preview 中的“通用打印”API。
MS Graph Explorer 显示的代码片段是:
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var stream = await graphClient.Print.Printers["{printerID}"].Jobs["{jobID}"].Documents["{documentID}"].Content
.Request()
.GetAsync();
但是......当我将此代码粘贴到我的 C# VS2019 .NET Core 3.1 代码中时,它抱怨说:
'IPrintDocumentRequestBuilder' does not contain a definition for 'Content' and no accessible extension method 'Content' accepting a first argument of type 'IPrintDocumentRequestBuilder' could be found (are you missing a using directive or an assembly reference?)
这是一个惊喜,更糟糕的是,当我通过 dotPeek 查看 Microsoft.Graph.Beta.dll (0.32.0-preview) 时,错误似乎是正确的,没有 IPrintDocumentRequestBuilder 的 Content 方法。
有谁知道为什么 MS Graph Explorer 中的代码片段建议使用 Microsoft.Graph.Beta.dll 中不存在的 C# 方法?或者更好的是我需要做些什么才能让它工作?
我的目标是通过 MS Graph Explorer 下载打印作业文档的内容。X
解决方案
IPrintDocumentRequestBuilder.Content() 现在出现在 DLL 中。对我有用的版本是 v0.38.0-preview https://www.nuget.org/packages/Microsoft.Graph.Beta/0.38.0-preview/
推荐阅读
- ios - 我以编程方式创建的按钮从我的应用程序中推送 Apple Maps 应用程序停止工作.. 为什么?
- ios - Swift 懒惰初始化不符合协议
- java - 无法同时创建 Kafka 消费者组
- bash - bash中的十六进制到十进制转换而不使用gawk
- c# - 在转换 C# 之前检查 DbNull
- python - Python如何在不取消缩进的情况下注释掉for语句
- android - 无法使用媒体控制器将媒体项目添加到队列
- oauth-2.0 - 在 Authlib 的示例 oauth2 服务器中,为什么 user_id 绑定到客户端元数据?
- mongodb - MongoDB + Postgres(或者我需要一个图形数据库吗?)
- java - org.sf.beans.factory.NoSuchBeanDefinitionException:没有可用的 X 类型的合格 bean