Hi, I got another problem when operate collection.
at serias.Points.AddY(dataValues.GetValue(0, j))
-------------------------------------------------------------------
Public Sub UpdateChart(ByVal Chart As ProcessX.VSTA.UIWrapper.Chart, ByVal mydata As linkinfo)
ReadData(dataValues)
Dim serias As Series
serias = Chart.Series("S1")
For j = 0 To dataValues.Length - 1
serias.Points.AddY(dataValues.GetValue(0, j))
Next
End Sub
-------------------------------
vsta throw an exception:
-------------------------------
A first chance exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll
can't regist one object twice (It is not excactly the vsta print bacause the language environment, I translate it).
--------------------------------------
I try to debug in the host , here is the exception stack:
---------------------------------------
mscorlib.dll!System.Runtime.Serialization.ObjectManager.RegisterObject(object obj, long objectID, System.Runtime.Serialization.SerializationInfo info, long idOfContainingObj, System.Reflection.MemberInfo member, int[] arrayIndex) + 0x385 bytes
> Microsoft.VisualStudio.Tools.Applications.Adapter.v9.0.dll!Microsoft.VisualStudio.Tools.Applications.SerializableObjectContractFormatter.DeserializeArray(System.AddIn.Contract.ISerializableObjectContract deserialize, System.AddIn.Contract.SerializableObjectData data, System.Type typeToReturn, Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager typeInfrastructureManager) + 0x291 bytes
Microsoft.VisualStudio.Tools.Applications.Adapter.v9.0.dll!Microsoft.VisualStudio.Tools.Applications.SerializableObjectContractFormatter.Deserialize(System.AddIn.Contract.ISerializableObjectContract deserialize, System.Type expectedType, Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager typeInfrastructureManager = {Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager}) + 0x2ab bytes
Microsoft.VisualStudio.Tools.Applications.Adapter.v9.0.dll!Microsoft.VisualStudio.Tools.Applications.TypeServices.DeserializeToObject(System.AddIn.Contract.ISerializableObjectContract contract, System.Type expectedType, Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager typeInfrastructureManager) + 0x58 bytes
Microsoft.VisualStudio.Tools.Applications.Adapter.v9.0.dll!Microsoft.VisualStudio.Tools.Applications.TypeServices.ObjectFromContract(System.AddIn.Contract.IContract remoteContract, System.Type expectedType, Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager typeInfrastructureManager) + 0x29a bytes
Microsoft.VisualStudio.Tools.Applications.Adapter.v9.0.dll!Microsoft.VisualStudio.Tools.Applications.TypeServices.ObjectFromRemoteArgument(System.AddIn.Contract.RemoteArgument remoteArg, System.Type expectedType, Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager typeInfrastructureManager) + 0xa6 bytes
Microsoft.VisualStudio.Tools.Applications.Adapter.v9.0.dll!Microsoft.VisualStudio.Tools.Applications.Internal.AdapterHelpers.PreProcessArguments(System.AddIn.Contract.Collections.IRemoteArgumentArrayContract arguments = {System.Runtime.Remoting.Proxies.__TransparentProxy}, System.Reflection.ParameterInfo[] parameters = {System.Reflection.ParameterInfo[1]}, Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager typeInfrastructureManager = {Microsoft.VisualStudio.Tools.Applications.TypeInfrastructureManager}, out Microsoft.VisualStudio.Tools.Applications.Internal.ContractLockData lockData = {Microsoft.VisualStudio.Tools.Applications.Internal.ContractLockData}) + 0xda bytes
Microsoft.VisualStudio.Tools.Applications.Adapter.v9.0.dll!Microsoft.VisualStudio.Tools.Applications.RemoteMethodInfoAdapter.System.AddIn.Contract.Automation.IRemoteMethodInfoContract.Invoke(System.AddIn.Contract.Automation.IRemoteObjectContract target, System.Reflection.BindingFlags bindingFlags = Instance | Static | Public | InvokeMethod, System.AddIn.Contract.Collections.IRemoteArgumentArrayContract arguments = {System.Runtime.Remoting.Proxies.__TransparentProxy}, int lcid = 0) + 0x58 bytes
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(System.RuntimeMethodHandle md, object[] args, object server, int methodPtr, bool fExecuteInContext, out object[] outArgs) + 0x23 bytes
mscorlib.dll!System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage msg, int methodPtr, bool fExecuteInContext) + 0x13b bytes
mscorlib.dll!System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage msg) + 0xc bytes
mscorlib.dll!System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x55 bytes
mscorlib.dll!System.Runtime.Remoting.Lifetime.LeaseSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage msg) + 0x1e bytes
mscorlib.dll!System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(System.Runtime.Remoting.Messaging.IMessage reqMsg) + 0x71 bytes
mscorlib.dll!System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(object[] args) + 0x7f bytes
mscorlib.dll!System.Runtime.Remoting.Channels.ChannelServices.DispatchMessage(System.Runtime.Remoting.Channels.IServerChannelSinkStack sinkStack, System.Runtime.Remoting.Messaging.IMessage msg = {System.Runtime.Remoting.Messaging.MethodCall}, out System.Runtime.Remoting.Messaging.IMessage replyMsg = null) + 0x22e bytes
mscorlib.dll!System.Runtime.Remoting.Channels.DispatchChannelSink.ProcessMessage(System.Runtime.Remoting.Channels.IServerChannelSinkStack sinkStack, System.Runtime.Remoting.Messaging.IMessage requestMsg, System.Runtime.Remoting.Channels.ITransportHeaders requestHeaders, System.IO.Stream requestStream, out System.Runtime.Remoting.Messaging.IMessage responseMsg, out System.Runtime.Remoting.Channels.ITransportHeaders responseHeaders, out System.IO.Stream responseStream) + 0x32 bytes
System.Runtime.Remoting.dll!System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(System.Runtime.Remoting.Channels.IServerChannelSinkStack sinkStack = {System.Runtime.Remoting.Channels.ServerChannelSinkStack}, System.Runtime.Remoting.Messaging.IMessage requestMsg = {System.Runtime.Remoting.Messaging.MethodCall}, System.Runtime.Remoting.Channels.ITransportHeaders requestHeaders, System.IO.Stream requestStream, out System.Runtime.Remoting.Messaging.IMessage responseMsg = null, out System.Runtime.Remoting.Channels.ITransportHeaders responseHeaders = null, out System.IO.Stream responseStream = null) + 0x3bc bytes
System.Runtime.Remoting.dll!System.Runtime.Remoting.Channels.Ipc.IpcServerTransportSink.ServiceRequest(object state) + 0x172 bytes
System.Runtime.Remoting.dll!System.Runtime.Remoting.Channels.SocketHandler.ProcessRequestNow() + 0x34 bytes
System.Runtime.Remoting.dll!System.Runtime.Remoting.Channels.RequestQueue.ProcessNextRequest(System.Runtime.Remoting.Channels.SocketHandler sh) + 0x17 bytes
System.Runtime.Remoting.dll!System.Runtime.Remoting.Channels.SocketHandler.BeginReadMessageCallback(System.IAsyncResult ar) + 0xb6 bytes
System.Runtime.Remoting.dll!System.Runtime.Remoting.Channels.Ipc.IpcPort.AsyncFSCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* pOverlapped) + 0x50 bytes
mscorlib.dll!System.Threading._IOCompletionCallback.PerformIOCompletionCallback(uint errorCode, uint numBytes, System.Threading.NativeOverlapped* pOVERLAP) + 0x54 bytes
--------------------------------------------------------------------
and will print:
---------------------------------------------
A first chance exception of type 'System.Runtime.Serialization.SerializationException' occurred in mscorlib.dll
A first chance exception of type 'System.Runtime.Serialization.SerializationException' occurred in Microsoft.VisualStudio.Tools.Applications.Adapter.v9.0.dll
A first chance exception of type 'System.Runtime.Serialization.SerializationException' occurred in Microsoft.VisualStudio.Tools.Applications.Adapter.v9.0.dll
----------------------------------------------
Could you give me some hints?
Thanks.
Yongming