One of WCF's goals is interoperability with standard protocol stacks, like WSE or other WS-* implementations. This led, I am told, to the design of WCF's default object serializer - the DataContractFormatSerializer. This handy …
I've been using WCF for the past few months and on the whole, I think the programming model works. I'm getting to really like the extensibility model and the whole deal seems to click rather well. One place where I feel it's a …
Doing work on our WinForm application, we find ourselves having to make choices - too many choices - about the UI. We don't have access to professional UI engineers, unfortunately, and we make uneducated guesses on too many issues - …
When we step back for a moment from our SOAs and Factories and Polymorphism, we have to admit that at the root of much of our code lie a hell of a lot of simple if/else statements. Like it or not, they're what makes our program logic …
A client asked me the other day what happened to File->Properties in Word 2007. They simply couldn't find it.
In the Beta1 TR, I remember it was confusingly located on the Status Bar (!) – right-click, pick View and View Properties. …
The following code is perfectly valid C#, and compiles without errors:
int _;_ = 5;
If we take it a bit further, we can do something like this:
int _, __, ___, ____;
_ = 5; __ = 10; ___ = 15; ____ = 20;
_ = __ - _ * ____ / ___;
Now I feel …
How many times have you connected to a server via Remote Desktop to install some components?How many have you rebooted a remote server and sat around waiting for it to go up?How many times have you opened a command prompt and ran ping -t …
I've mentioned it before, but SysInternal's DebugView is a great utility. It allows you to get the Debug.WriteLine() strings from your application even when you're not attached with a debugger, as long as it was compiled in Debug mode. Very …
I'm uninstalling an old beta of the Sharepoint servers from a VPC I have on my computer to make room for the newer Beta 2 servers, and I noticed several things:
1) The installation originally required a then-current build of Windows …
WCF's Instance Context model allows me to specify my service's instantiation behavior - I can get a new instance for every call, have WCF manage a session for me and keep an instance per session, or just get lazy and have my service …
Taking a break from the main components, I decided to get around to writing a small configuration editor using .NET 2.0's lovely ability to edit .config files from code.
I have a custom Section Handler defined for my data, and decided the …
It's easy to forget that even though a local filesystem path ("C:MyDirMyFile.dll") can be represented as a Uri (file://C:/MyDir/MyFile.dll), these two entities are different, and have different rules for validations.
The problem du jour, …
In my previous post, I noted that when I write this code in C#:
public void MyMethod (params object[] args) { ... }
What I actually get in my IL is this:
public void MyMethod ([System.ParamArray]object[] args) { ... }
I have this suspicion …
I noticed today that the ever-popular String.Format() method has several overloads - in addition to the Format(string format, params object[] args) overload I was expecting, it seems there are three special-case overloads for one, two or …
For various reasons involving out testing framework, I found myself needing to get the full command-line of the current executing assembly. However, our development environment uses the DOS SUBST command to map a virtual drive letter for …
For various debugging processes, I find myself needing to find several bits of runtime information for my properties. This means I want to get the property's PropertyInfo object by Reflection when that property's code is running.
The …
Dictionaries have been an annoyance when serializing for a while now. IDictionary in v1.1 and now IDictionary in v2.0 are both non-serializable, forcing us to find workarounds or use DataTables or any number of unsatisfactory solutions.
My …
I was sitting around munching some code, and needed to filter a list I had:
List list = // get list
outputList = list.FindAll(delegate(Whatever item){ if (// blah blah) { return true; } else { return false; }});
(Ignore the greyed-out text …
Just a quick tip to prevent others from feeling as foolish as I do:
The static CreateDirectory() method of the System.IO.Directory class will create the entire directory tree passed to it. There's no need to write an EnsurePathExists() …
A relatively obscure new keyword in C# 2.0 is the default(T) keyword. It's shorthand for checking if the given generic parameter T is a value type or reference type. If it's a reference type, it returns null. Otherwise it returns …