简体   繁体   中英

Remoting: fill the collection on remote side

I have simple remoting API that has method similar to this:

bool FillMyList(List<string> ListToFill)
{
    ListToFill.Add("something");
    ListToFill.Add("more stuff");
}

But, when I call it through a proxy object, upon return, ListToFill stays as it was (in my case, empty).

What now? I must point out that rest of my methods are called fine - they pass parameters in one direction and have return value for the other.

All you typically get back from Remoting calls is the return value; the parameters are not marshalled across, usually. Marking the parameter ref probably won't help, but it may depend on how you are doing the remoting. Having the function return the list itself instead of the bool or a custom object that includes both, should solve it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM