1

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.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
Apeiron
  • 694
  • 7
  • 13

1 Answers1

3

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.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • It is defined in a seperate project called OamsIDD, but I will take a look for other reference missmatches. – Apeiron Nov 02 '11 at 17:02
  • @Apeiron: Check whether the project which declares the event has a reference to a different version of OamsIDD, basically. – Jon Skeet Nov 02 '11 at 17:05
  • I beleive this is correct, playing with references fixed the problem. Seams like the problem occurred because the problem with the original error used a project reference, while other projects it depended on referred to the same project by dll instead of project reference. Thanks, I don't think I would have looked there without your suggestion. – Apeiron Nov 02 '11 at 17:22