重写者跳过某些方法 [英] Rewriter skipping certain methods

查看:80
本文介绍了重写者跳过某些方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个零星的问题,其中某些方法似乎被重写者跳过。 因此,这些方法中的Contract.Ensures语句最终在运行时调用Microsoft.Contracts实现,后者又调用AssertMustUseRewriter并使用以下错误消息暂停我的程序:"使用Contract.Ensures时必须使用重写器"。 。

具体来说,我已经通过局部类将一些静态辅助方法添加到了由VS.Net中的Settings.settings文件生成的Settings.cs类中。 这些辅助方法中包含Contract.Ensures语句,这些语句有时在编译时不会被重写器重写。

I have been experiencing a sporadic issue in which certain methods appear to be skipped by the rewriter.  As a result, Contract.Ensures statements in these methods end up calling the Microsoft.Contracts implementation at runtime, which in turn calls AssertMustUseRewriter and halts my program with an error message that says: "Must use the rewriter when using Contract.Ensures".

Specifically, I have added some static helper methods via a partial class to the Settings.cs class that gets generated by the Settings.settings file in VS.Net.  These helper methods have Contract.Ensures statements in them, and these statements are sometimes not rewritten by the rewriter at compile time.

推荐答案

感谢您报告此事问题。你有一套repro步骤,所以我们可以解决这个问题吗?

Thanks for reporting this issue. Do you have a set of repro steps for us so we can fix this?


这篇关于重写者跳过某些方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆