473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

NullReference Exception inside remoting

I traced this all the to the domain boundary. I also but a breakpoint
in the server. That was never hit. It happens after it leaves the
client but before it calls into the "add" method in the server. I don't
know how to debug this any further.

exact error message and code follows

this is what fails. it fails on the add.
TestContactInfo tci = new TestContactInfo();
tci.Address1 = "address1";
tci.Address2 = "address2";
tci.Address3 = "address3";
tci.Address4 = "address4";
tci.City = "City";
tci.Comment = "Comment";
tci.ContactFor = contactFor;
tci.ContactID = contactID;
tci.Country = "Country";
tci.Email = "Email";
tci.Fax1 = "Fax1";
tci.Fax2 = "Fax2";
tci.Name = "Name";
tci.Phone1 = "Phone1";
tci.Phone2 = "Phone2";
tci.PostalCode = "PostalCode";
tci.State = "State";
tci.Title = "Title";
tci.Url = "Url";
Assert.IsTrue(tci.IsDirty(), "Should be dirty");
tci.ResetDirty();
Assert.IsFalse(tci.IsDirty(), "Should not be dirty");
mgr.Add<TestContactInfo>(tci);

this is the signature for the add method
public void Add<T>(T contact) where T : ContactInfo

public abstract class ContactInfo : IData
{
protected ContactInfo originalData;
/// <summary>
/// </summary>
/// <remarks>Sets the initial values so that the IsDirty method
works if the data is changed after population</remarks>
public virtual bool IsDirty()
{
return !(originalData.Address1.Equals(Address1)
&& originalData.Address2.Equals(Address2)
&& originalData.Address3.Equals(Address3)
&& originalData.Address4.Equals(Address4)
&& originalData.City.Equals(City)
&& originalData.Comment.Equals(Comment)
&& originalData.ContactID.Equals(ContactID)
&& originalData.Country.Equals(Country)
&& originalData.Email.Equals(Email)
&& originalData.Fax1.Equals(Fax1)
&& originalData.Fax2.Equals(Fax2)
&& originalData.Name.Equals(Name)
&& originalData.Phone1.Equals(Phone1)
&& originalData.Phone2.Equals(Phone2)
&& originalData.PostalCode.Equals(PostalCode)
&& originalData.State.Equals(State)
&& originalData.Title.Equals(Title)
&& originalData.Url.Equals(Url)
);
}
public virtual void ResetDirty()
{
originalData = (ContactInfo)MemberwiseClone();
}
private string _contactID = string.Empty;

public string ContactID
{
get { return _contactID; }
set { _contactID = value; }
}
//insert more properties here. snipped for brevity
}

[Serializable]
public class TestContactInfo : ContactInfo
{
public TestContactInfo()
{
ResetDirty();
}
}
Server stack trace:
at
System.Runtime.Remoting.Messaging.MethodCall.Resol veMethod(Boolean
bThrowIfNotResolved)
at System.Runtime.Remoting.Messaging.MethodCall..ctor (Object
handlerObject, BinaryMethodCallMessage smuggledMsg)
at
System.Runtime.Serialization.Formatters.Binary.Bin aryMethodCall.ReadArray(Object[]
callA, Object handlerObject)
at
System.Runtime.Serialization.Formatters.Binary.Obj ectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage methodCallMessage)
at
System.Runtime.Serialization.Formatters.Binary.Bin aryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck, Boolean
isCrossAppDomain, IMethodCallMessage methodCallMessage)
at
System.Runtime.Remoting.Channels.CoreChannel.Deser ializeBinaryRequestMessage(String
objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel
securityLevel)
at
System.Runtime.Remoting.Channels.BinaryServerForma tterSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
requestStream, IMessage& responseMsg, ITransportHeaders& respon
seHeaders, Stream& responseStream)

Exception rethrown at [0]:
at
System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage
reqMsg, IMessage retMsg)
at
System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData&
msgData, Int32 type)
at IVS.Framework.IContactService.Add[T](Identity id, T contact)
Apr 26 '07 #1
1 1349
Dan Holmes wrote:
I traced this all the to the domain boundary. I also but a breakpoint
in the server. That was never hit. It happens after it leaves the
client but before it calls into the "add" method in the server. I don't
know how to debug this any further.
....
>
this is the signature for the add method
public void Add<T>(T contact) where T : ContactInfo
i changed that to: public void Add(ContactInfo contact) and it works.
Essentially removing the generic markers.

anyone know why?

dan
Apr 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Larry Re | last post by:
I've written a small C# app which appears to work perfectly except for the fact that I get a NullReference exception when I close the form using the red 'X' in the upper right hand corner of the...
3
by: Tom | last post by:
Hi, I built a class project (classproject.dll) and a web project (webproject.dll). The web project needs to reference to that class project. They can compile without error. But, it has...
0
by: Mike Grishaber | last post by:
I am using .NET Remoting to connect my incoming HTTP Requests to my business logic. I am using a custom IHttpAsyncHandler to receive the incoming HTTPRequests and then I forward the...
2
by: Natalia DeBow | last post by:
Hi there, I am working on an client-server app, where the client asynchronously issues a request for the server to perform some action and the server is supposed to notify the client when the...
0
by: stand__sure | last post by:
in re-reading something on .NET remoting I realized that I had done nothing with lease sponsorship and renewal. so, I dug around in msdn2 and found this topic...
4
by: Sharon | last post by:
Hi, I'm using the remoting, and I have a remoting object that has a public event that other processes should register to it. But when the client process is registering to the remote event, it...
5
by: Paul Cheetham | last post by:
Hi, I have moved a fairly large project from VS2003 to VS2005, and now trying to get it running. It now compiles OK after minimal changes, but I am now getting a NullReference Exception on...
4
by: yogarajan | last post by:
hi i had developed pop3 Account mail view in my web page but i got error in (System.NullReference Exception: Object reference not set) NetStrm.Write(szData, 0, szData.Length); - this line ...
6
by: Steve | last post by:
Hi All I have a windows forms Application (SAM) in vb.net 2008 using .net framework V2 One and only one customer out of 30 customers is getting errors daily where they have to close and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.