Archives

Archives / 2006
  • Wrapping the RAS

    Tags: .NET, C#, CodeSnippets

    A couple of years ago I had a need to automate dialing a RAS connection and retrieving the IP address allocated by the server. I found myself writing a small, rather limited wrapper around the RAS P/ … more

  • Crossing the line - Reflection and Reality

    Tags: .NET, C#, Reflection

    When we're working Reflection, we tend to think in different terms than we do when we're actually calling methods. There's an extra level of abstraction in everything we do. Translating between these … more

  • Creating CustomBindings programatically

    Tags: WCF, WinFX

    I had another revelation earlier, when going over Nicholas Allen's explanation of the GetProperty<T> method and BindingContexts:The Binding objects supplied by the WCF framework are only a … more

  • Aggregated Interface Implementation

    I've been struggling around the aggregation used in WCF's Binding object model, as implemented in the GetProperty<T> method (see relevant discussions with Nicholas Allen from the WCF team here … more

  • WCF: Navigating the Binding maze

    Tags: WCF, WinFX

    A few days ago I ranted a bit about the Binding object model in WCF and how restrictive it feels when I want to imperatively describe my service bindings without being tied down to a specific … more

  • WCF and Non-polymorphic bindings

    Tags: .NET, WCF, WinFX

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

  • A silly little C# language feature request: .! operator

    Tags: C#

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

  • File Properties in Word 2007

    Tags: Office

    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 (!) – … more

  • Ping Notifier!

    Tags: .NET, CodeSnippets

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

  • Visual Studio obstructing DebugView

    Tags: .NET, Visual Studio

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

  • My Singleton is disappearing!

    Tags: .NET, WCF, WinFX

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

  • Hiding properties from the Property Grid

    Tags: .NET, CodeSnippets

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

  • URIs are not local paths.

    Tags: .NET

    It's easy to forget that even though a local filesystem path ("C:\MyDir\MyFile.dll") can be represented as a Uri (file://C:/MyDir/MyFile.dll), these two entities are different, and have different … more

  • ParamArrays and CLS-compliance.

    Tags: .NET, C#

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

  • 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

  • System.Reflection.Omit

    Tags: .NET, Reflection

    In TechEd Israel 2006, I listened to Roy Osherove's excellent talk on the new reflection features in .NET 2.0 - a great assortment of topics on things ranging from DynamicMethods to the … more

  • Indigo Errors Perplexing

    Tags: .NET, WCF, WinFX, WinFX January CTP

    I was writing a very simple WCF service. Nothing fancy - just returning an array of structs via TCP, just like 3 others already implemented. Started testing, stepped through the server code, returned … more

  • One-Click Wonder

    Tags: Miscellaneous Debris

    It turns out that you can easily close a tab with one click on the middle mouse button. On most modern mice, this would be the scroll wheel button. No fuss, no right-clicking, no selecting the tab … more

  • A new conditional assignment operator??

    Tags: .NET, C#, CodeSnippets

    This one may have slipped beneath the radar, with all the new .NET 2.0 and WinFX and other improvements and APIs and language changes. It appears that C# 2.0 adds a new operator to the mix, and I … more

  • VSS and mapped file locations

    Tags: .NET

    Just a quick tip about the some new problems we're having with VSS:To ease integration and control, all developers on the team have their local development drive mapped to drive P:\, to make sure all … more

  • VSS2005 - staying in line

    Tags: .NET, Miscellaneous Debris

    Working with Visual SourceSafe always feels to me like walking on eggshells. One wrong move and you get that sickening crunching feeling and things seem to collapse.My current project's integrator … more

  • Genericizing the GenericProxy<T>

    Tags: .NET, WinFX

    A few days ago, Guy Burstein wrote a entry on avoiding design-time generated proxies by extending the ClientBase class to create a GenericProxy. This proxy uses the client binding data in the app. … more

  • Kerberos and Web Service Preauthentication

    Tags: .NET

    My current project has been having various inconsistent, irreproducible 401 Unauthorized errors on our web service calls. We tried various tests, checks, changes and wild guesses, and we think we’ve … more

  • When is a dash not a dash?

    Tags: Miscellaneous Debris

    An interesting an unusually frustrating pitfall that I've stumbled into a few times: Many times when we're preparing for deployment of a software product, we find ourselves preparing a Word document … more

  • Macro Origins

    Tags: Miscellaneous Debris

    I've been wondering about the origin and etymology of the term "macro" as it is used in programming. The general use for it is to mean something large - the opposite of "micro" - but it didn't seem … more