SYSK 397: Xamarin-Forms-Labs CalendarView control is not rendered in Win8 phone

If you downloaded XLabs open source controls from https://github.com/XLabs/Xamarin-Forms-Labs and trying to use them in a Xamarin project targeting Windows phone 8, you may be having “blank” rendering (calendar not displayed) issue – note that the space for the control is taken which can be seen by setting control’s background property.  I had this issue attempting…

0

SYSK 396: FxCop Rules for RESTful API

There are a few well known basic naming rules providing a consistent, understandable REST API services, e.g. The scheme and host name are not case sensitive; however, the path and query should be treated as case sensitive. Lowercase letters are preferred in URI paths.  Do use hyphens (-) between words to improve readability of URI…

0

SYSK 395: DataAnnotations: ConditionallyRequiredAttribute with lamda expressions

Back in 2010, Jeff Hanley published a sample of a ConditionallyRequiredAttribute that used a name of another property for runtime condition verification.  The original source can be found at http://jeffhandley.com/archive/2010/09/26/RiaServicesCustomReusableValidators.aspx.  I took the liberty to update it to support lambda expressions, allowing for more complex rules, e.g. [ConditionallyRequired(typeof(YourClass), “(x) => { return x.Prop1 == 5…

0

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

SYSK 389: How to set ClientCredentials via Configuration file in Client

I’m working on a project where a service hosted elsewhere requires Windows authentication.  As a consultant, my computer is not on the customer’s domain, so, using my logged-on Windows credentials won’t do any good.  And, doing nothing results in the following exception:  “The caller was not authenticated by the service.” and inner exception is “The…

0

SYSK 388: Differences between basicHttpBinding and wsHttpBinding

Doing a web search for a difference between basicHttpBinding and wsHttpBinding, I find just generic references to basicHttpBinding being a basic implementation of SOAP1.1, and wsHttpBinding supporting all the WS-* spec. So, I did a side by side comparison using Microsoft Service Configuration Editor – differences (in available settings and defaults) are indicated by red…

1