【发布时间】:2011-04-30 02:11:36
【问题描述】:
我有一个带有标记为过时属性的方法的接口。 attributes error 参数设置为 true 以在使用时抛出异常。问题是这会导致存根无法为整个班级生成。当我将值更改为 false 时,存根会按预期生成。
我正在寻找一种方法来生成存根,同时将 error 参数保留为 true。
public interface ICar
{
void Start();
[Obsolete("this is obsolete Stop, stop using it", true)]
void Stop();
}
我尝试了不同的排列方式。
<Moles xmlns="http://schemas.microsoft.com/moles/2010/">
<Assembly Name="My.Car.Services"/>
<StubGeneration>
<TypeFilter TypeName="ICar" SkipObsolete="true" />
</StubGeneration>
</Moles>
【问题讨论】: