を委任一致するための過負荷:「<method>」マイ「セキュリティ」アセンブリは、このコード「を含む<delegate>」
public delegate void InteropEventDelegate(InteropEventType etype, string data, string data2, string data3);
public event InteropEventDelegate InteropEvent;
第2組立は、私の「セキュリティ」アセンブリを参照すると、このコードが含まれています
void LoadSecurity()
{
if (!AssemblyIsLocked && Security == null)
{
this.Security = new Security.Security(UnlockCode);
this.Security.InteropEvent += new Security.Security.InteropEventDelegate(Security_InteropEvent);
}
}
void Security_InteropEvent(InteropEventType etype, string data, string data2, string data3)
{
throw new NotImplementedException();
}
IntelliSenseによってSecurity_InteropEventが生成され、正しいシグネチャを持っていますが、「Security_InteropEvent」のオーバーロードがデリゲート「Security.Security.InteropEventDelegate」に一致しないというエラーが発生します。どうして?
私はこの勧告を2番目に推奨します。単純な抜粋 'Security = new Security.Security'は同じ単語に対して3つの意味を持っています! – configurator
はい、InteropEventTypeが定義されているアセンブリ間でENUMS.CSファイルを共有していました。両方の場所で同じように定義されていますが、2つの別々のタイプとして扱われると思います。アセンブリ間で列挙型を共有する方法はありますか – PahJoker
@PahJoker:1つのアセンブリを他のアセンブリを参照することによって、基本的に列挙型を共有します。 2つの異なるアセンブリにタイプを定義しないでください。問題が発生する可能性があります。 –