<p>I'm currently writing an interface to allow applications to send exception data to a central repository for support purposes. I'm at a quandary about how to pass extra contextual data:</p>

<pre><code>public interface IExceptionNotifier
{
    void Notify(Exception ex, NameValueCollection context); //this      
    void Notify(Exception ex, IDictionary&lt;string, string&gt; context); //or this
}
</code></pre>

<p>I've often found myself is a similar position when creating lookups. Ignoring whether or not the exception notifier concept is good, is it be best to use an <code>IDictionary&lt;string, string&gt;</code> or <code>NameValueCollection</code>? Why would you pick one over the other?</p>

If the context is a throw-away value and (here comes the important part) will not be serialized, e.g. for sending the data to another system, I'd go with the IDictionary because it makes using your interface more flexible.
If, on the other hand, the context is kept all the time or the context will be serialized, use NameValueCollection because then you are under control of what you'll actually get from your caller.
Edit: mausch is right in that you should use a generic approach, but I still wouldn't use an interface if you want to serialize the data.