Apeiron
Apeiron

Reputation: 704

Method '' cannot handle event '' because they do not have a compatible signature

Method 'Private Sub trigger_Triggered(sender As Object, e As OamsIDD.VoamsWorldIDD.OamsStateChangeEventArgs)' cannot handle event 'Public Event Triggered(sender As Object, e As OamsIDD.VoamsWorldIDD.OamsStateChangeEventArgs)' because they do not have a compatible signature.

I have the above error which I cannot make heads or tails about why. I understand what the error means, but even when I let VS automatically generate a stub for me, it still produces this error.the most peculiar part, this error is not produced when compiling from command line, but only from inside visual studio, both 2005 and 2010.

to make it a little easier to see here are the two signatures:

Private Sub trigger_Triggered(sender As Object, e As OamsIDD.VoamsWorldIDD.OamsStateChangeEventArgs)
Public Event Triggered(sender As Object, e As OamsIDD.VoamsWorldIDD.OamsStateChangeEventArgs)

The event declaration is defined in another project, but the projects are linked via project references. What could cause this or is this a bug in Visual studio, if so is there a work around? Thank you.

Upvotes: 1

Views: 8474

Answers (1)

Jon Skeet
Jon Skeet

Reputation: 1499770

Is OamsIDD.VoamsWorldIDD.OamsStateChangeEventArgs declared in two different projects, by any chance? That would explain it - if the event refers to one type, but your handler refers to a different one.

Upvotes: 3

Related Questions