[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Get "not marked as serializable" when passing VB6 Type as a parameter

DotNetJunkies User

6/28/2004 8:35:00 PM

Hi,
I have a project where I need to separate a VB app from his components that will reside on a separate machine. I've decided to use the .Net remoting to do accomplish this. My solution is to recreate the .net components with the same signature that the vb components and only change the references in my VB app and recompile it. This way, when the vb app creates a new obejct, the .net component is being created instead of the vb component. The .net component then creates a remote call to access the vb code on a remote machine.

When a remote call is done with a vb class, everything works fine, but when the call has a vb public type as a parameter, I always get the "not marked as serializable" error. Does anyone has an idea of what it may be?

thanks

---
Posted using Wimdows.net NntpNews Component -

Post Made from http://www.DotNetJunkies.com/... Our newsgroup engine supports Post Alerts, Ratings, and Searching.
1 Answer

Sunny

6/28/2004 9:15:00 PM

0

Hi,

In article <OOGNX9UXEHA.2844@TK2MSFTNGP12.phx.gbl>, User@-NOSPAM-
DotNetJunkies.com says...
> Hi,
> I have a project where I need to separate a VB app from his components that will reside on a separate machine. I''ve decided to use the .Net remoting to do accomplish this. My solution is to recreate the .net components with the same signature that the vb components and only change the references in my VB app and recompile it. This way, when the vb app creates a new obejct, the .net component is being created instead of the vb component. The .net component then creates
a remote call to access the vb code on a remote machine.
>
> When a remote call is done with a vb class, everything works fine, but when the call has a vb public type as a parameter, I always get the "not marked as serializable" error. Does anyone has an idea of what it may be?

To pass an object with remoting it have to:
1. inherit from MarshalByReferenceObject - thus passed by reference

or

2. Marked with [Serializable] attribute, thus passed by value.

As your public vb class is neither, remoting fails.



Sunny

>
> thanks
>
> ---
> Posted using Wimdows.net NntpNews Component -
>
> Post Made from http://www.DotNetJunkies.com/... Our newsgroup engine supports Post Alerts, Ratings, and Searching.
>