I've built an aspect that uses a class in one of my own libraries for its work. the class needed to be made serializable in order to be useful but when getting PostSharp to do its thing I'm getting this error:
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.
does anyone know what I could be missing?
p.s. the definition for that class looks like this:
Namespace NextGen.Framework.Managers.LogMgr
<Serializable>
Public Class NxLogMgr
- update -
in googling I did find this (from the PostSharp developer):
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
(see: http://support.sharpcrafters.com/discussions/problems/484-additional-exception-detail)
so my aspect uses this LogMgr class, which is declared as serializable, but cannot be loaded by the CLR why?