Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations

  • Problems with params array?

    Tags: .NET

    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 … more

  • Query SUBST information

    Tags: .NET, CodeSnippets

    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 … more

  • From Accessors to Properties

    Tags: .NET, Reflection

    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 … more

  • Serializing Dictionaries

    Tags: .NET, CodeSnippets

    Dictionaries have been an annoyance when serializing for a while now. IDictionary in v1.1 and now IDictionary<K,V> in v2.0 are both non-serializable, forcing us to find workarounds or use … more

  • Creating nested directories

    Tags: .NET

    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 … more

  • Context-Bound Thread Queuer - FunFun.

    Tags: .NET, CodeSnippets, WCF, WinFX

    As I mentioned in my previous post, I have a need to consistently pass an operation context to any thread I choose to spin. Doing so manually, as I did here, involves a lot of ugly, repetitive code … more

  • Share your interfaces - avoid static proxies.

    Tags: .NET, WCF, WinFX

    When using WCF services, we have several options for creating the proxies. We can create them statically using SVCUTIL or the build-in IDE support (Add Service Reference...), or we can generate them … more