PropertyChanged: Could not inject EventInvoker method on type

Fody.PropertyChanged version: 2.2.5

My solution compiles fine from both visual studio and visual studio for mac. It fails to compile, however, from Travis CI or from Appveyor CI.

The error message:

MSBUILD : error : Fody: Could not inject EventInvoker method on type ‘AGS.Engine.AGSButton’. It is possible you are inheriting from a base class and have not correctly set ‘EventInvokerNames’ or you are using a explicit PropertyChanged event and the event field is not visible to this instance. Either correct ‘EventInvokerNames’ or implement your own EventInvoker on this class. If you want to suppress this place a [DoNotNotifyAttribute] on AGS.Engine.AGSButton. [C:\projects\monoags\Source\Engine\AGS.Engine\AGS.Engine.csproj]

Complete log: https://ci.appveyor.com/project/tzachshabtay/monoags/build/1.0.522/job/v42a3fyq5djabjyf

My solution is here: https://github.com/tzachshabtay/MonoAGS

The AGSButton class can be seen here: https://github.com/tzachshabtay/MonoAGS/blob/master/Source/Engine/AGS.Engine/ComponentsFramework/Templates/AGSButton.generated.cs

It inherits from AGSEntity which does have a DoNotNotify attribute, and can be seen here: https://github.com/tzachshabtay/MonoAGS/blob/master/Source/Engine/AGS.Engine/ComponentsFramework/AGSEntity.cs

So it shouldn’t try to inject at all (and I don’t want to decorate AGSButton with DoNotNotify, I have a lot of inheritors from AGSEntity).

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 18 (7 by maintainers)

Most upvoted comments

I get this error when I have an object that inherits from ReactiveObject from the ReactiveUI library. I had to create the following class and use it instead:

public class MyReactiveObject : ReactiveObject
   {
      protected void RaisePropertyChanged(PropertyChangedEventArgs args)
       {
           ((IReactiveObject)this).RaisePropertyChanged( args);
       }
   }

@ltrzesniewski that issue helped solve my problem.

@tmt242001

can someone upload a minimal solution that reproduces this issue. or better yet send a PR with a failing unit test

can someone upload a minimal solution that reproduces this issue. or better yet send a PR with a failing unit test