If you like C# or VB.net, no doubt you'd like your Managed Exchange Event Sink to be configurable. In .Net 2.0 you'd use the Settings class to wrap your App.config file in a strongly typed class. Alas, you'll find that when you deploy your Event Sink, whatever changes you make to your MyEventSink.dll.config file are completely ignored. Problem: not only is your sink a dll which is hosted by %windir%\system32\dllhost.exe but it is also a COM+ application. You can resolve this problem either of two ways (the first one being a terrible idea):
1. Create a file called dllhost.exe.config, put all of your app.config text in there and deploy it to %WINDIR%\System32\ and pray that no one else has the same terrible idea; or
2. Create two text files, application.manifest and application.config, and point your COM+ application's "Application Base Directory" to whatever directory contains these files. Then add the contents of your pre-existing config file to application.config and the following to application.manifest
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"/>
Once you're finished, stop and restart your COM+ application and you're all set! Your Managed Exchange Event Sink will read whatever configuration data you've specified in the application.config file and you no longer need MyEventSink.dll.config.
Labels: .Net, COM+, Exchange