[Mono-list] Accessing data members in remote objects
Jamin Philip Gray
jamin@pubcrawler.org
Thu, 27 Feb 2003 14:09:29 -0600 (CST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---1463811583-742370379-1046376569=:18072
Content-Type: TEXT/PLAIN; charset=US-ASCII
I'm having a problem with remoting. It works great for accessing methods
on the proxy of a remote object, but not on data members. When I access a
data member I get:
Unhandled Exception: System.NullReferenceException: A null value was found
where an object instance was required
in <0x00126> 00 TestCode.Remoting.SampleClient:Main (string[])
I'm Attaching the source code for my SampleObject, SampleServer, and
SampleClient.
--
name: Jamin Philip Gray
email: jamin@pubcrawler.org
icq: 1361499
aim: jamingray47
yahoo: jamin47
web: http://pubcrawler.org
Got Linux?
---1463811583-742370379-1046376569=:18072
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="SampleObject.cs"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0302271409290.18072@eowyn.dolinux.foobar>
Content-Description:
Content-Disposition: attachment; filename="SampleObject.cs"
dXNpbmcgU3lzdGVtOw0KdXNpbmcgU3lzdGVtLlJ1bnRpbWUuUmVtb3Rpbmc7
DQp1c2luZyBTeXN0ZW0uUnVudGltZS5SZW1vdGluZy5DaGFubmVsczsNCnVz
aW5nIFN5c3RlbS5SdW50aW1lLlJlbW90aW5nLkNoYW5uZWxzLlRjcDsNCg0K
bmFtZXNwYWNlIFRlc3RDb2RlLlJlbW90aW5nDQp7DQogIHB1YmxpYyBjbGFz
cyBTYW1wbGVPYmplY3QgOiBNYXJzaGFsQnlSZWZPYmplY3QgDQogIHsNCg0K
ICAgIHB1YmxpYyBpbnQgY291bnRlcjsNCg0KICAgIHB1YmxpYyBTYW1wbGVP
YmplY3QoKQ0KICAgIHsNCiAgICAgIGNvdW50ZXIgPSAwOw0KICAgIH0NCg0K
ICAgIHB1YmxpYyBpbnQgR2V0Q291bnQoKQ0KICAgIHsNCiAgICAgIGNvdW50
ZXIrKzsNCiAgICAgIHJldHVybiBjb3VudGVyOw0KICAgIH0NCg0KICAgIC8v
IE1ha2Ugb2JqZWN0IGxpdmUgZm9yZXZlcg0KICAgIHB1YmxpYyBvdmVycmlk
ZSBPYmplY3QgSW5pdGlhbGl6ZUxpZmV0aW1lU2VydmljZSgpDQogICAgew0K
ICAgICAgcmV0dXJuIG51bGw7DQogICAgfQ0KICB9DQp9DQoNCg==
---1463811583-742370379-1046376569=:18072
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="SampleServer.cs"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0302271409291.18072@eowyn.dolinux.foobar>
Content-Description:
Content-Disposition: attachment; filename="SampleServer.cs"
dXNpbmcgU3lzdGVtOw0KdXNpbmcgU3lzdGVtLlJ1bnRpbWUuUmVtb3Rpbmc7
DQp1c2luZyBTeXN0ZW0uUnVudGltZS5SZW1vdGluZy5DaGFubmVsczsNCnVz
aW5nIFN5c3RlbS5SdW50aW1lLlJlbW90aW5nLkNoYW5uZWxzLlRjcDsNCg0K
bmFtZXNwYWNlIFRlc3RDb2RlLlJlbW90aW5nDQp7DQogIHB1YmxpYyBjbGFz
cyBTYW1wbGVTZXJ2ZXINCiAgew0KICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBN
YWluKHN0cmluZyBbXSBhcmdzKSANCiAgICB7DQogICAgICAvLyBDcmVhdGUg
YW4gaW5zdGFuY2Ugb2YgYSBjaGFubmVsDQogICAgICBUY3BDaGFubmVsIGNo
YW5uZWwgPSBuZXcgVGNwQ2hhbm5lbCg4MDgwKTsNCiAgICAgIENoYW5uZWxT
ZXJ2aWNlcy5SZWdpc3RlckNoYW5uZWwoY2hhbm5lbCk7DQoNCiAgICAgIC8v
IENyZWF0ZSBhbiBpbnN0YW5jZSBvZiBvdXIgb2JqZWN0DQogICAgICBTYW1w
bGVPYmplY3Qgb2JqID0gbmV3IFNhbXBsZU9iamVjdCgpOw0KDQogICAgICAv
LyBQdWJsaXNoIG91ciBvYmplY3QNCiAgICAgIFJlbW90aW5nU2VydmljZXMu
TWFyc2hhbChvYmosICJTYW1wbGVPYmplY3QiKTsNCg0KICAgICAgU3lzdGVt
LkNvbnNvbGUuV3JpdGVMaW5lKCJQcmVzcyB0aGUgZW50ZXIga2V5IHRvIGV4
aXQuLi4iKTsNCiAgICAgIFN5c3RlbS5Db25zb2xlLlJlYWRMaW5lKCk7DQog
ICAgfQ0KICB9DQp9DQoNCg==
---1463811583-742370379-1046376569=:18072
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="SampleClient.cs"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.44.0302271409292.18072@eowyn.dolinux.foobar>
Content-Description:
Content-Disposition: attachment; filename="SampleClient.cs"
dXNpbmcgU3lzdGVtOw0KdXNpbmcgU3lzdGVtLlJ1bnRpbWUuUmVtb3Rpbmc7
DQp1c2luZyBTeXN0ZW0uUnVudGltZS5SZW1vdGluZy5DaGFubmVsczsNCnVz
aW5nIFN5c3RlbS5SdW50aW1lLlJlbW90aW5nLkNoYW5uZWxzLlRjcDsNCg0K
bmFtZXNwYWNlIFRlc3RDb2RlLlJlbW90aW5nDQp7DQogIHB1YmxpYyBjbGFz
cyBTYW1wbGVDbGllbnQNCiAgew0KICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBN
YWluKHN0cmluZyBbXSBhcmdzKQ0KICAgIHsNCg0KICAgICAgQ2hhbm5lbFNl
cnZpY2VzLlJlZ2lzdGVyQ2hhbm5lbChuZXcgVGNwQ2hhbm5lbCgpKTsNCiAg
ICAgICAgICAgDQogICAgICBSZW1vdGluZ0NvbmZpZ3VyYXRpb24uUmVnaXN0
ZXJXZWxsS25vd25DbGllbnRUeXBlKA0KICAgICAgICB0eXBlb2YoU2FtcGxl
T2JqZWN0KSwgDQogICAgICAgICJ0Y3A6Ly9sb2NhbGhvc3Q6ODA4MC9TYW1w
bGVPYmplY3QiKTsNCiAgICAgIFNhbXBsZU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