0
다른 클래스가있는 C# .exe 파일이 있습니다.리플렉션 (어셈블리)을 사용하여 클래스 속성을 얻는 방법
실행 파일 내에서 클래스 내에있는 속성을 가져와야합니다.
가 지금 임은이 일을 :Assembly a = Assembly.LoadFile(servicePath);
foreach (Type t in a.GetTypes())
{
Console.WriteLine(t.Name);
}
그리고이 클래스는 콘솔에 기록되는 것을 볼 수 있습니다, 지금 내가 어떻게 by the way I don't and won't have that class referenced in my project
클래스의 속성을받을 수 있나요?
이 내 클래스 : 그 클래스 내에서이 변수를 얻을 필요가
/// <summary>
/// Summary description for ProjectInstaller.
/// </summary>
[RunInstaller(true)]
public class SyncServiceInstaller : System.Configuration.Install.Installer
{
private System.ServiceProcess.ServiceProcessInstaller serviceProcessInstaller1;
private System.ServiceProcess.ServiceInstaller serviceInstaller1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public SyncServiceInstaller()
{
// This call is required by the Designer.
InitializeComponent();
}
}
: serviceInstaller1
어떤 단서?
당신은 그'어디에요()'와'.FIrstOrDefault()'를 교체하고 제거 할 수있는'.FirstOrDefault()'당신이 가진 것을 요청합니다. –
@Matt 좋은 생각! – Rickey