本文介绍了C#中缺少Microsoft Graph ChatMessage命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在关注 Microsoft Graph教程,用于创建聊天消息并从C#发送聊天消息到Microsoft Teams频道.

I'm following the Microsoft Graph tutorial to create and send a chat message to a Microsoft Teams channel from C#.

但是,尝试创建ChatMessage对象时,遵循第一个示例时出现错误. (var chatMessage = new ChatMessage...)错误是:

However, I'm getting an error when following the first example when trying to create a ChatMessage object. (var chatMessage = new ChatMessage...) The error is:

我已经在我的项目中添加了以下引用,但是它们似乎都不包含ChatMessage类定义:

I've added the following references to my project already but none of them seem to contain the ChatMessage class definition:

  • Microsoft.Graph
  • Microsoft.Graph.Core
  • Microsoft.Graph.Auth
  • Microsoft.Graph
  • Microsoft.Graph.Core
  • Microsoft.Graph.Auth

ChatMessage文档为我提供了有关ChatMessage资源类型的更多信息,但没有告诉我应该从哪里获得.

The ChatMessage documentation gives me a little more information on the ChatMessage resource type but doesn't tell me where I should get it from.

我发现的唯一其他内容是 Windows.ApplicationModel.Chat.ChatMessage ,但是我在Nuget中找不到windows.applicationmodel.chat,我不确定这是否正确,因为在Graph教程页面上没有提及它.

The only other thing I've found is Windows.ApplicationModel.Chat.ChatMessage, but I can't find windows.applicationmodel.chat in Nuget, and I'm not sure if this is actually correct as there's no mention of it on the Graph tutorial page.

能够在本教程中使用ChatMessage对象是什么意思?

What am I doing wrong to be able to use the ChatMessage object in the tutorial?

推荐答案

为了调用Microsoft Graph的Beta版本(即/beta/...),您需要使用 Microsoft.Graph.Beta NuGet包, not Microsoft.Graph 软件包.后者仅包含已发布的API(即/v1.0/...).

In order to call into the Beta version of Microsoft Graph (i.e. /beta/...), you need to use the Microsoft.Graph.Beta NuGet package, not the Microsoft.Graph package. The later only contains APIs that have been released (i.e. /v1.0/...).

这篇关于C#中缺少Microsoft Graph ChatMessage命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 01:30