A while ago, I posted an article on how to create managed event sinks. This is a follow-up on that article covering application settings.
Normally, application files are named after the .EXE file which hosts a managed component: An .exe file called myapplication.exe has a configuration file of myapplication.exe.config which resides in the same directory as the myapplication.exe file.
There are two issues when dealing with Exchange event sinks: First, the working directory is %systemroot%\system32. And second, the executable host is svchost.exe. With .NET 1.1, the only option here was to create a svchost.exe.config in %systemroot%\system32. Bad days for those with more than one managed COM+ application on one server.
Since .NET 2.0, the world has become a better place. At least, in this scenario. You can now place your configuration data in a file named application.config and place that file into the folder where your COM+ application resides. You must then create an xml file in that directory with the name application.manifest and the following content:
1 <?xmlversion="1.0"encoding="UTF-8"standalone="yes"?>
2 <assemblyxmlns="urn:schemas-microsoft-com:asm.v1"manifestVersion="1.0" />
Now, you must reconfigure your COM+ application to set the working directory to the directory where your COM+ DLLs reside: Open Component Services, navigate to your applicatoin and open the properties.
Activation propertysheet in component services (click to enlarge)In the text box Application Root Directory, specify the path your event sink.
That's all.