Reputation: 1217
I created a xamarin forms solution from Prism Template pack on visual studio on mac. I am getting Fody exception.
Error: Fody: Could not inject EventInvoker method on type 'sdfdf.App'. 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 sdfdf.App. (sdfdf)
I cannot compile any project because of fody weaver. FodyWeaver
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<PropertyChanged EventInvokerNames="RaisePropertyChanged" />
<RealmWeaver />
</Weavers>
If i remove PropertyChanged
event from fody weaver, app is working fine but i need it for the app. Does anyone know how to resolve this issue ?
UPDATE
As per the suggestion, I updated the body weaver and got the following error. FodyWeaver
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<PropertyChanged/>
<RealmWeaver />
</Weavers>
Error: Fody: An unhandled exception occurred: Exception: Could not resolve type with token 01000041 (from typeref, class/assembly
Fody.TypeSystem, FodyHelpers, Version=3.1.3.0, Culture=neutral, PublicKeyToken=1ca091877d12ca03) Type: System.TypeLoadException StackTrace: at ModuleWeaver.InitEventArgsCache () [0x00000] in C:\projects\propertychanged\PropertyChanged.Fody\EventArgsCacheInjector.cs:5 at ModuleWeaver.Execute () [0x00084] in C:\projects\propertychanged\PropertyChanged.Fody\ModuleWeaver.cs:29
at (wrapper dynamic-method) System.Object.lambda_method(System.Runtime.CompilerServices.Closure,object) at InnerWeaver.ExecuteWeavers () [0x00087] in C:\projects\fody\FodyIsolated\InnerWeaver.cs:200 at InnerWeaver.Execute () [0x0004d] in C:\projects\fody\FodyIsolated\InnerWeaver.cs:102 Source: PropertyChanged.Fody TargetSite: Void InitEventArgsCache()
Upvotes: 0
Views: 366
Reputation: 833
With Fodyweavers you only need to add this:
<Weavers>
<PropertyChanged/>
</Weavers>
Documentation:
https://github.com/Fody/PropertyChanged
Upvotes: 1