更新团队清单 - 未设置对象引用
Update Teams Manifest - Object reference not set
我们目前正在构建一个 MS Teams 应用程序,我们正处于 POC 阶段。
当使用 Visual studio 中的菜单使用清单中的最新更改更新清单时,出现以下错误。 项目 -> TeamsFx -> 更新团队清单
System.NullReferenceException: Object reference not set to an instance of an object.
at TeamsFx.VisualStudio.Definitions.AppDefinitionBot.FromAppManifestBot(AppManifestBot appManifestBot)
at TeamsFx.VisualStudio.Commands.TeamsAppManifest.<>c.<MergeIntoTeamsAppDefinitionAsync>b__18_2(AppManifestBot bot)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at TeamsFx.VisualStudio.Commands.TeamsAppManifest.<MergeIntoTeamsAppDefinitionAsync>d__18.MoveNext()
bot定义如下:
"bots": [
{
"botId": "someId",
"needsChannelSelector": false,
"isNotificationOnly": false,
"scopes": [
"team",
"personal",
"groupchat"
]
}
],
然后我们只有 composeExtensions 来展示卡片,用 2 个简单的例子来测试它是如何工作的。
"composeExtensions": [
{
"botId": "someId",
"canUpdateConfiguration": true,
"commands": [
{
"id": "createCard",
"type": "action",
"context": [ "message" ],
"description": "Command to run action to create a Card from Compose Box",
"title": "Create Card",
"parameters": [
{
"name": "title",
"title": "Card title",
"description": "Title for the card",
"inputType": "text"
},
{
"name": "subTitle",
"title": "Subtitle",
"description": "Subtitle for the card",
"inputType": "text"
},
{
"name": "text",
"title": "Text",
"description": "Text for the card",
"inputType": "textarea"
}
]
},
{
"id": "createAdaptiveCard",
"type": "action",
"context": [ "message" ],
"description": "Command to run action to create a Card from Compose Box",
"title": "Adaptive Card",
"parameters": [
{
"name": "title",
"title": "Name",
"description": "Name of the User",
"inputType": "text"
},
{
"name": "subTitle",
"title": "Designation",
"description": "Designation of the User",
"inputType": "text"
},
{
"name": "text",
"title": "Description",
"description": "Description",
"inputType": "textarea"
}
]
}
]
}
],
最终结果是 MS Teams 中的应用 运行 它没有引入最新的更改。
TeamFx 验证通过且没有错误。我的假设是清单文件中有问题,尽管我找不到任何突出的内容。
谁能告诉他们以前是否遇到过这个问题以及如何解决?
提前致谢。
我发现解决方案是在清单文件的机器人部分中包含以下内容:
"commandLists": []"
如果未定义,则抛出异常。已定义,但只有一个空列表,已解决。
我们目前正在构建一个 MS Teams 应用程序,我们正处于 POC 阶段。
当使用 Visual studio 中的菜单使用清单中的最新更改更新清单时,出现以下错误。 项目 -> TeamsFx -> 更新团队清单
System.NullReferenceException: Object reference not set to an instance of an object.
at TeamsFx.VisualStudio.Definitions.AppDefinitionBot.FromAppManifestBot(AppManifestBot appManifestBot)
at TeamsFx.VisualStudio.Commands.TeamsAppManifest.<>c.<MergeIntoTeamsAppDefinitionAsync>b__18_2(AppManifestBot bot)
at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at TeamsFx.VisualStudio.Commands.TeamsAppManifest.<MergeIntoTeamsAppDefinitionAsync>d__18.MoveNext()
bot定义如下:
"bots": [
{
"botId": "someId",
"needsChannelSelector": false,
"isNotificationOnly": false,
"scopes": [
"team",
"personal",
"groupchat"
]
}
],
然后我们只有 composeExtensions 来展示卡片,用 2 个简单的例子来测试它是如何工作的。
"composeExtensions": [
{
"botId": "someId",
"canUpdateConfiguration": true,
"commands": [
{
"id": "createCard",
"type": "action",
"context": [ "message" ],
"description": "Command to run action to create a Card from Compose Box",
"title": "Create Card",
"parameters": [
{
"name": "title",
"title": "Card title",
"description": "Title for the card",
"inputType": "text"
},
{
"name": "subTitle",
"title": "Subtitle",
"description": "Subtitle for the card",
"inputType": "text"
},
{
"name": "text",
"title": "Text",
"description": "Text for the card",
"inputType": "textarea"
}
]
},
{
"id": "createAdaptiveCard",
"type": "action",
"context": [ "message" ],
"description": "Command to run action to create a Card from Compose Box",
"title": "Adaptive Card",
"parameters": [
{
"name": "title",
"title": "Name",
"description": "Name of the User",
"inputType": "text"
},
{
"name": "subTitle",
"title": "Designation",
"description": "Designation of the User",
"inputType": "text"
},
{
"name": "text",
"title": "Description",
"description": "Description",
"inputType": "textarea"
}
]
}
]
}
],
最终结果是 MS Teams 中的应用 运行 它没有引入最新的更改。
TeamFx 验证通过且没有错误。我的假设是清单文件中有问题,尽管我找不到任何突出的内容。
谁能告诉他们以前是否遇到过这个问题以及如何解决?
提前致谢。
我发现解决方案是在清单文件的机器人部分中包含以下内容:
"commandLists": []"
如果未定义,则抛出异常。已定义,但只有一个空列表,已解决。