我有一个调用t.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
的代码,其中t
是类CTopic
的类型。该类包含属性Key
,其方式如下所示:
public interface IKey
{
object Key { get; set; }
}
public interface IKey<T> : IKey
{
T Key { get; set; }
}
public abstract class CBean<T> : IKey<T>
{
public abstract T Key { get; set; }
object IKey.Key { get; set;}
}
public class CTopic : CBean<string>
{
public override string Key
{
get { return string.Empty; }
set { string s = value; }
}
}
GetProperties
方法正在为&#34; Key&#34;返回PropertyInfo
(等等) debug mode
中的财产。但是同样的代码为&#34; Key&#34;返回两个PropertyInfo [s]。 release mode
中的财产。
我尝试通过创建一个单独的项目来复制它,并且引用包含CTopic
类的程序集并且类似地调用GetProperties
但不能在调试和释放模式中复制奇怪的情况。
是否存在任何项目级别设置或其他设置?