我使用的是7.0.6版的Audit.NET。
config.Filters.Add(new Audit.WebApi.AuditApiAttribute());当我运行应用程序时,它给出了以下运行时错误
self referencing loop detected with type Appinstance.Path 'Action.ActionParameters.request.Properties.MS_HttpContext.ApplicationInstance.Context'.
我使用的是Nuget的最新版本的Newtonsoft.JSON。
发布于 2017-05-16 14:54:14
你能提供堆栈跟踪吗?
该错误意味着Newtonsoft.Json无法序列化具有引用循环的对象,但是Audit.NET上默认使用的json转换已经处理了这个问题,方法是忽略ReferenceLoopHandling设置为Ignore的引用循环。
https://github.com/thepirat000/Audit.NET/blob/master/src/Audit.NET/AuditEvent.cs#L73
是否使用自定义数据提供程序保存事件?
如果是这样,请确保使用提供的AuditEvent ToJson方法,或处理自引用的任何其他方法。
https://stackoverflow.com/questions/43973700
复制相似问题