0

I'm getting an exception when I run this code in my plugin:

            CBugFieldPlugin customFields = (CBugFieldPlugin)api.AllPlugins.PluginFromId("CustomFields@fogcreek.com");
            StringBuilder sb = new StringBuilder();
            foreach (CBugField field in customFields.BugFields()) {
                sb.AppendFormat("{0} - {1}<br/>\r\n", field.sName, field.sDescription);
            }
            return sb.ToString();

The exception:

System.Runtime.Serialization.SerializationException: Type 'FogCreek.Plugins.BugField.CBugField' in Assembly 'FogCreek.Plugins.BugField, Version=1.0.2.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.


   Server stack trace: 
   at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)
   at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
   at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteArray(WriteObjectInfo objectInfo, NameInfo memberNameInfo, WriteObjectInfo memberObjectInfo)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
   at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.SerializeMessageParts(ArrayList argsToSerialize)
   at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage..ctor(IMethodReturnMessage mrm)
   at System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage.SmuggleIfPossible(IMessage msg)
   at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
   at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)
   Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at FogCreek.Plugins.BugField.CBugFieldPlugin.BugFields()
       at BugSubmission.BugSubmissionPlugin.RawPageDisplay()

Fog Creek Case FC2211214

flag

2 Answers

1

Looks like this might just be a problem with the version of FogBugz I was using? It looks like it's working on a different server that happens to be entirely up to date.

link|flag
0

If you see this error in FogBugz, please contact us for help resolving it: http://www.fogcreek.com/sendmail.html

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.