3

I have a wcf service which I use Miquels Castro's technique, instead of user the service reference create by VS.NET 2010.

Everything worked great until I added a new method. When I added the new method I got a error message:

A first chance exception of type 'System.ServiceModel.FaultException`1' occurred in mscorlib.dll

Additional information: Object reference not set to an instance of an object.

Then

An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in Unknown Module.

Additional information: Type 'System.ServiceModel.ExceptionDetail' in Assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.

The code hits the proxy class:

public DataTable GetResearchSellingTitles(string network, string year, 
    string quarter)
{
    return Channel.GetResearchSellingTitles(network, year, quarter);
}

I have added the method to the interface and implemented it. Any ideas how to determine the root of the issue?

Update I solved the issue. It had nothing to do with th WCF service setup. What is weird is where I had where the null reference error, it was surrounded by a try catch. I also had a log util that log the error. I am not sure why it just didn't catch the error, log it and return a empty datatable. Thanks for all the suggestions.

John Saunders
  • 157,405
  • 24
  • 229
  • 388
H20rider
  • 1,870
  • 4
  • 24
  • 44
  • That looks like the server is getting a `NullReferenceException` and passing it to the client in an `ExceptionDetail` object, which, for some reason, is failing to serialize. – John Saunders May 06 '11 at 00:46
  • anyway to debug this? I cant seem to get at the root of the issue – H20rider May 06 '11 at 04:34
  • possible duplicate of [What is a NullReferenceException and how do I fix it?](http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – nvoigt Feb 15 '14 at 13:24

0 Answers0