共用方式為


How to use Application Root directory option to configure application.config for a specific COM+ application

We would like to use the app.config file for a specific COM+ application. Generally we create dllhost.exe.config and put that in System32 directory. But this
app.config will then be applicable to all the COM+ server applications.

Resolution :

1. Create config and manifest file for COM+ application. Name them after the COM+ application name. for e.g. <COM+ app name>.manifest and <COM+ app name>.config

<COM+ application name>.manifest (no changes required, you can use the following manifest as it is) :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
</assembly>

<COM+ app name>.config (change the assembly identity and codebase section for the assembly) :

<?xml version ="1.0"?>
<configuration>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
          <assemblyIdentity name="<dll name>" culture="neutral" publicKeyToken="6de37167d58dd222"/>
          <codeBase version="1.0.0.0" href="FILE://C:\RePro\CommonLibrary.dll"/>
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
</configuration>

2. Go to the COM+ application properties --> Activation tab and specify the path to the app.manifest and app.config file in the Application Root Directory.

Comments