[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.dotnet.framework.remoting

Static constructor called on client for SAO?

rory.plaire

8/25/2004 2:40:00 AM

Greetings,

I have a SAO which uses a singleton pattern. I want to expose the
singleton factory via remoting so I set up the remoting infrastructure
to publish as a well-known object in Singleton mode. On the client, I
grab the URL and Activator.GetObject or RemotingServices.Connect. When
I do this, the static initializer on the type is called from the
client-side, and events which were wired up on the server side are
never captured...

How does this behavior occur? Why is the static constructor on the
class being called client-side? I've seen a post on this group about
having an explicit static constructor, which I do... so that's not it.

thanks!
-rory
2 Answers

Sam Santiago

8/25/2004 5:05:00 AM

0

Check out this link regarding remoting:

Scope of Publication
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconscopeofpubli...

Here's an excerpt:

"Static fields and methods are never remoted, and field access is through
direct memory. That is, .NET remoting always deals with instance members of
some form. "

Thanks,

Sam

--
_______________________________
Sam Santiago
ssantiago@n0spam-SoftiTechture.com
http://www.SoftiTe...
_______________________________
"Rory Plaire" <rory.plaire@co.benton.or.us> wrote in message
news:28e92646.0408241839.70322d41@posting.google.com...
> Greetings,
>
> I have a SAO which uses a singleton pattern. I want to expose the
> singleton factory via remoting so I set up the remoting infrastructure
> to publish as a well-known object in Singleton mode. On the client, I
> grab the URL and Activator.GetObject or RemotingServices.Connect. When
> I do this, the static initializer on the type is called from the
> client-side, and events which were wired up on the server side are
> never captured...
>
> How does this behavior occur? Why is the static constructor on the
> class being called client-side? I've seen a post on this group about
> having an explicit static constructor, which I do... so that's not it.
>
> thanks!
> -rory


rory.plaire

8/25/2004 3:05:00 PM

0

"Sam Santiago" <ssantiago@n0spam-SoftiTechture.com> wrote in message news:<#NcPKEmiEHA.2764@TK2MSFTNGP11.phx.gbl>...
> Check out this link regarding remoting:
>
> Scope of Publication
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconscopeofpubli...

Ah... I thought it must be so. Thanks for the pointer, it was just
what I was looking for!

-rory 8)