J'ai construit un aspect qui utilise une classe dans une de mes bibliothèques pour son travail. la classe nécessaire pour être sérialisable pour être utile, mais lors de l'obtention PostSharp à faire sa chose j'obtenir cette erreur:Impossible de trouver un sérialiseur pour le type
PostSharp 3.0 [3.0.35.0, 64 bit, CLR 4.5, Release] - Copyright (c) SharpCrafters
s.r.o., 2004-2012.
POSTSHARP : error LA0001: Cannot serialize the aspects: Cannot find a serializer
for type 'NextGen.Framework.Managers.LogMgr.NxLogMgr'..
POSTSHARP : message PS0122: Details of the previous error or warning:\nPostSharp
.Serialization.PortableSerializationException: Cannot find a serializer for type
'NextGen.Framework.Managers.LogMgr.NxLogMgr'.
POSTSHARP : message PS0122: at PostSharp.Serialization.SerializationWriter.Ge
tObjectInfo(Object obj)
POSTSHARP : message PS0122: at PostSharp.Serialization.SerializationWriter.Wr
iteObjectReference(Object value, Boolean writeInitializationDataInline)
POSTSHARP : message PS0122: at PostSharp.Serialization.SerializationWriter.Wr
iteValue(Object value, SerializationIntrinsicType intrinsicType, Boolean writeIn
itializationDataInline)
POSTSHARP : message PS0122: at PostSharp.Serialization.SerializationWriter.Wr
iteArguments(Arguments arguments, Boolean writeInitializationArgumentsInline)
POSTSHARP : message PS0122: at PostSharp.Serialization.SerializationWriter.Se
rialize(Object obj)
POSTSHARP : message PS0122: at ^RIeE65/59SwT.^AiEkYplb()
POSTSHARP : error PS0060: The processing of module "NextGen.BusinessObject.Posti
ngQueueMgr_3Base.dll-PostSharp.dll" was not successful.
personne ne sait ce que je pourrais être absent?
p.s. la définition de cette classe ressemble à ceci:
Namespace NextGen.Framework.Managers.LogMgr
<Serializable>
Public Class NxLogMgr
- mise à jour -
à googler j'ai trouvé cela (le développeur PostSharp):
it happens when you are trying to serialize a Type inside the aspect, and the Type cannot be loaded by the CLR as a Runtime Type. PostSharp then provides reflection wrappers, but these cannot be serialized
(voir: http://support.sharpcrafters.com/discussions/problems/484-additional-exception-detail)
donc mon aspect utilise cette classe LogMgr, qui est déclarée sérialisable, mais qui ne peut pas être chargée par le CLR pourquoi?
cela fonctionne. oui!!! – ekkis
Existe-t-il un exemple d'implémentation d'un ReferenceTypeSerializer personnalisé? La documentation est assez éparse sur ce sujet. –