自定义工作流活动运行产生System.Security.SecurityException
摘要: 微软动态CRM专家罗勇 ,回复305或者20190224可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me!我的网站是 www.luoyong.me 。
最近碰到一个问题,某些自定义工作流活动运行报如下错误,红色部分是参考号,每次都不一样。
System.Security.SecurityException:Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #*******
自定义工作流活动一般是注册在沙盒中,在沙盒日志中有错误产生,看到工作流异常终止,看不出什么问题。奇怪的是自定义工作流活动代码非常靠前的获取追踪服务应该打印出的消息没有打印出来。
ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService));
tracingService.Trace("Message from tracing Custom Code Activity..");
当然后来我们找到原因了,这个报错是代码中用异步POST请求去调用API,这个调用不通产生异常导致的。因为是异步,所以在AsyncService的日志中是可以看到错误的,Unable to connect the remote server.
那为啥tracingService应该能打印的消息没有打印出来呢?
原来代码中对这个异步调用API服务用try ... catch ... 包括出来了。如果有异常的话,在异常处理catch部分处理更新记录状态为失败外,再一次使用throw new ex; 的方式将异常抛出来了。
错就错在这个抛出异常的方法,应该使用建议的抛出异常的方式 throw new InvalidPluginExecutionException(ex.Message) 来抛出异常就好了,这样自定义工作流活动运行异常时,tracingService打印的信息也可以看到了,更加有助于排查问题。
自定义工作流活动运行产生System.Security.SecurityException的更多相关文章
- Dynamics 365中自定义工作流活动获取的上下文分析及注意事项
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复244或者20170306可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong. ...
- (C#)为应用程式设定运行权限(System.Security类下的GenericIdentity,GenericPrincipal,PrincipalPermission)
最近看书<编写高质量代码改善C#程序的157个建议>,知识点备忘: System.Security.Principal.GenericIdentity==>表示一般用户 System ...
- Dynamics 365 CE将自定义工作流活动程序集注册到磁盘并引用其他类库
我是微软Dynamics 365 & Power Platform方面的工程师罗勇,也是2015年7月到2018年6月连续三年Dynamics CRM/Business Solutions方面 ...
- System.Security.SecurityException The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception
[15/08/19 00:03:10] [DataManager-7292-ERROR] System.Reflection.TargetInvocationException: Exception ...
- System.Security.SecurityException The source was not found, but some or all event logs could not be searched.Inaccessible logs Security.
An exception occurred during the Install phase. System.Security.SecurityException The source was not ...
- Windows服务安装异常:System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志。不可 访问的日志: Security
Windows服务安装异常:System.Security.SecurityException: 未找到源,但未能搜索某些或全部事件日志.不可 访问的日志: Security 2种方法处理: 一.右键 ...
- 自定义工作流活动报错:您无法登陆系统。原因可能是您的用户记录或您所属的业务部门在Microsoft Dynamics 365中已被禁用。
本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复265或者20170926可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong.me ...
- Dynamics 365 CE的插件/自定义工作流活动中调用Web API示例代码
微软动态CRM专家罗勇 ,回复325或者20190428可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me! 现在Web API越来越流行,有时候为了程序更加健壮,需要在插件 ...
- Dynamics 365中自定义工作流活动更新了输入输出参数后获取的方法
关注本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复245或者20170309可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyong. ...
随机推荐
- Hadoop 集群安装(主节点安装)
1.下载安装包及测试文档 切换目录到/tmp view plain copy cd /tmp 下载Hadoop安装包 view plain copy wget http://192.168.1.100 ...
- 记录一次JavaWeb开发的乱码解决
POST提交的中文,测试能正确接收到,而且在控制台打印出中文 但是存到数据库乱码 查看了数据库,设置的是utf-8,最后发现应该在数据库连接的地方设置: jdbc:mysql://localhost: ...
- [Swift]LeetCode31. 下一个排列 | Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permuta ...
- [Swift]LeetCode467. 环绕字符串中唯一的子字符串 | Unique Substrings in Wraparound String
Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz" ...
- [Swift]LeetCode685. 冗余连接 II | Redundant Connection II
In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) f ...
- [Swift]LeetCode692. 前K个高频单词 | Top K Frequent Words
Given a non-empty list of words, return the k most frequent elements. Your answer should be sorted b ...
- Java IO流读取文件
使用指定编码读取文件 public static String toString(File file, String charset){ StringBuilder result = new Stri ...
- 强如 Disruptor 也发生内存溢出?
前言 OutOfMemoryError 问题相信很多朋友都遇到过,相对于常见的业务异常(数组越界.空指针等)来说这类问题是很难定位和解决的. 本文以最近碰到的一次线上内存溢出的定位.解决问题的方式展开 ...
- zabbix系列之九——添加钉钉告警
一.添加钉钉机器人 1. 2. 复制webhook后面脚本用到:https://oapi.dingtalk.com/robot/send?access_token=36e69dd50bbcc54b7b ...
- asp.net core系列 37 WebAPI 使用OpenAPI (swagger)中间件
一.概述 在使用Web API时,对于开发人员来说,了解其各种方法可能是一项挑战.在ASP.NET Core上,Web api 辅助工具介绍二个中间件,包括:Swashbuckle和NSwag .NE ...