【问题标题】:Postsharp 6.0.28, .NET 4.7.1 and a weird warning while compilingPostsharp 6.0.28、.NET 4.7.1 和编译时出现的奇怪警告
【发布时间】:2019-03-24 01:38:19
【问题描述】:

我在项目编译过程中遇到以下警告:

6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50):警告 PS0114: “BusinessLayer.BOMnt.GetAllTimerServices(System.Nullable, System.Nullable, System.Boolean, System.Boolean, System.String, System.Nullable)”的冲突方面: 转换“Model.Helper.MiniProfilerStepAttribute: Wrapped by advice(s) OnEntry, OnExit”和“Model.Helper.MiniProfilerStepAttribute: Wrapped by advice(s) OnEntry, OnExit”不是可交换的,但它们不是强排序的。他们的执行顺序是不确定的。 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: 先前警告的依赖关系详情: 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: Model.Helper.MiniProfilerStepAttribute: Marker BEFORE (0): 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50):消息PS0124:(无依赖关系) 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: Model.Helper.MiniProfilerStepAttribute: Marker BEFORE (1): 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50):消息PS0124:(无依赖关系) 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: Model.Helper.MiniProfilerStepAttribute: 由通知包裹 OnEntry, OnExit: 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: Action=Order, Position=After, Condition={equals "Model.Helper.MiniProfilerStepAttribute: Marker BEFORE (1)"} 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: Action=Order, Position=Before, Condition={equals "Model.Helper.MiniProfilerStepAttribute: Marker AFTER (1)"} 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: Model.Helper.MiniProfilerStepAttribute: 由通知包裹 OnEntry, OnExit: 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: Action=Order, Position=After, Condition={equals "Model.Helper.MiniProfilerStepAttribute: Marker BEFORE (0)"} 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: Action=Order, Position=Before, Condition={equals "Model.Helper.MiniProfilerStepAttribute: Marker AFTER (0)"} 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: Model.Helper.MiniProfilerStepAttribute: Marker AFTER (0): 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50):消息PS0124:(无依赖关系) 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: Model.Helper.MiniProfilerStepAttribute: Marker AFTER (1): 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50):消息PS0124:(无依赖关系) 6>C:\prj\InternalWSvc\development\BusinessLayer\BOMnt.cs(39,31,39,50): 消息 PS0124: .

这是什么意思,以后如何避免它的出现?

【问题讨论】:

  • 我们没有您的代码。您还在寻求哪些其他帮助(您可以合理地期望从互联网上的陌生人那里得到)消息尚未提供给您的其他帮助?

标签: c# aop postsharp


【解决方案1】:

这意味着您在 BusinessLayer.BOMnt.GetAllTimerServices 上有两个 MiniProfilerStepAttribute 实例。

【讨论】:

    【解决方案2】:

    我知道这是一个旧线程,但也许有人会发现它很有用。在我的情况下,重复是由方面继承引起的。更多细节在这里 https://blog.postsharp.net/post/deeper-into-aspect-inheritance.html

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多