SYSK 394: Cost of getting StackTrace and finding a StackFrame

I wanted to find out the overhead of getting the stack trace and finding a specific method in the array of stack frames.  The profiled code looked like this: private static MethodBase GetCallerMethod(string caller) {     StackTrace st = new StackTrace(2);     return (from f in st.GetFrames() let m = f.GetMethod() where m.Name == caller…

0

SYSK 393: Error: Cannot obtain Metadata (RESOLVED)

Not all error messages are created equal, and some of them are less helpful than others.  Here is one I came across —  “Metadata contains a reference that cannot be resolved…  An exception was thrown in a call to a WSDL export extension:System.ServiceModel.Description.DataContractSerializerOperationBehavior contract…  Type ‘YourNamespace.YourClass’ cannot be serialized. Consider marking it with the DataContractAttribute…

0

SYSK 391: Entities as a data contract

There may be instances when using data transfer objects (DTO) is appropriate. For example, if you need to control the serialization details, such as which members to serialize and which not to serialize, and if you need to change the names of the serialized members, or do data contract mapping based on service version, or…

0

SYSK 390: String.Format vs. concatenation

Since .NET 1.0, we’ve all been told – strings are immutable, so for best performance, avoid large number of string concatenation and use StringBuilder.  Ok, but how large is “large” and what about string.Format?If you use your favorite .NET de-compiler, you’ll see that string.Format does quite a bit of work, and it would be logical…

5