我有以下 WCF 课程:
namespace BusinessServices.Exposure.Data
{
[DataContract]
public class RiskItemBO : ExposureBO
{
[DataMember]
public RiskItemBusinessService RiskItemBusinessService { get; set; }
}
}
RiskItemBusinessService是一个在其他 DLL 中定义的类,由、String和Int变量Short组成。我有方法为这些数据类型生成随机值。
我有以下问题:
我正在使用 Type.GetProperties() 来获取类中的所有属性,这确实给了我属性的名称RiskItemBusinessService,但是,当我尝试这样做时PropertyInfo.PropertyType,我得到FileNotFoundException(RiskItemBusinessService在不同的 DLL 中)。为此,我正在捕获异常并将 DLL 加载到 catch 子句中,但是当我尝试这样做PropertyInfo.SetValue时,FileNotFoundException即使我刚刚使用Assembly.LoadFile.
