C# Development: I am calling a webservice/other methods in a try catch block with different parameters some of which may be custom objects. Please comment on the best way to log the parameters in a text file in case of an exception. Also is it possible to skip out some fields from an object (say for example if an object contains an image file which i dont want to log to the text file)
thanks for your time
The short answer is that you can't, not without going through hoops.
When you get an Exception, it contains stack trace info, but that information doesn't contain anything regarding the parameters that were passed to the method at the time.
To get around this, you have to store the parameters in your exception handler code so you can have access to them when the exception is handled.
For example, you would have an object which you would pass the parameter instances to (along with their names) and then call a method on that object in your catch block.