Logic Apps内联C#脚本无代码变更突然报错,确认存在破坏性更新
Azure Logic Apps 内联C#脚本添加
using System.Text.Json触发参数绑定错误 最近4天内的10次运行全部失败,「Execute CSharp Script Code」动作返回如下错误:
InvokeFunctionFailed
函数「CSharp_receive-email-test_execute_csharp_script_code.csx」执行时出现「Exception binding parameter 'context'」错误,请验证函数代码有效性。
未修改原有代码,经复现确认是Logic Apps内联C#的破坏性更新导致,复现步骤:
- 在设计器中添加「Execute CSharp Script Code」步骤;
- 使用官方示例代码时,工作流运行正常;
- 在脚本中添加
using System.Text.Json;语句后,立即触发上述错误。
解决方案
经确认,本次更新要求:使用System.Text.Json命名空间前,必须先添加程序集引用声明。将以下代码放在脚本最顶部即可解决问题:
#r "System.Text.Json" using System.Text.Json; // 后续脚本代码
内容的提问来源于stack exchange,提问作者Chris Harrington
相关产品推荐
相关产品推荐

