Prism 模板包:Xamarin 表单 - Fody 异常
Prism Template pack: Xamarin forms - Fody exception
我在 mac 的 visual studio 上从 Prism 模板包创建了一个 xamarin 表单解决方案。我遇到 Fody 异常。
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)
由于 fody weaver,我无法编译任何项目。
FodyWeaver
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<PropertyChanged EventInvokerNames="RaisePropertyChanged" />
<RealmWeaver />
</Weavers>
如果我从 fody weaver 中删除 PropertyChanged
事件,应用程序工作正常,但我需要它用于该应用程序。有谁知道如何解决这个问题?
更新
按照建议,我更新了 body weaver 并收到以下错误。
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()
使用 Fodyweavers,您只需添加以下内容:
<Weavers>
<PropertyChanged/>
</Weavers>
文档:
我在 mac 的 visual studio 上从 Prism 模板包创建了一个 xamarin 表单解决方案。我遇到 Fody 异常。
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)
由于 fody weaver,我无法编译任何项目。 FodyWeaver
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<PropertyChanged EventInvokerNames="RaisePropertyChanged" />
<RealmWeaver />
</Weavers>
如果我从 fody weaver 中删除 PropertyChanged
事件,应用程序工作正常,但我需要它用于该应用程序。有谁知道如何解决这个问题?
更新
按照建议,我更新了 body weaver 并收到以下错误。 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()
使用 Fodyweavers,您只需添加以下内容:
<Weavers>
<PropertyChanged/>
</Weavers>
文档: