COM server don't read normal config files so you either need to do it via code or use the following trick:
(Your COM server must be an .exe
)
- Go to dcomcnfg and create a COM+ application
- In the COM+ application there is a setting "Application Root Directory". Enter the folder where your .exe is located
- Add your com object to the COM+ application
Create a file named
Application.manifest
in the folder. The file must contain:<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" />Put your config file in the same folder. Note that the config file must have the exact name
Application.config
, not "myapp.exe.config"
Now the config file will work the same way as in your console application.