none
What/where do I put a .config file for an Exchange AddIn (transport agent) RRS feed

  • Question

  • Hi all;

    Ok, the rule is you create an app.exe.config, not a lib.dll.config. So what/where do I put the file for an Exchange transport agent? This is a .DLL that is incorporated into Exchange.

    I can't find a base exchange.exe that's running. And even if I could, I'm pretty sure putting my log4net config info in there to then impact all parts of exchange, is not a good idea. And even for the key=value pairs I need, where I can come up with unique key values, where do I put those?

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Thursday, October 10, 2013 4:37 PM

Answers

All replies

  • Hi Dave,

    Did you want to know where the log4net configuration information should be placed? please describe in detail so that we can help you.

    Thanks.

    Friday, October 11, 2013 9:22 AM
  • Hi;

    Yes, I want to know where to place the log4net configuration information. And where I should place the:

    <add key="bean" value="AutoSize"/>

    key/value pairs for the configuration values for my app also.

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Friday, October 11, 2013 12:43 PM
  • Hi David,

    First you should find the file in your solution, and add configuration like below:

    <configuration>

           <configSections>

                  <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

           </configSections>

           <log4net debug="false">

                  <appender name="LogFileAppender" type="log4net.Appender.FileAppender,log4net" >

                         <param name="File" value="c:\\hnguyen\\download\\log.txt" />

                         <param name="AppendToFile" value="true" />

                         <layout type="log4net.Layout.PatternLayout,log4net">

                               <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] &lt;%X{auth}&gt; - %m%n" />

                         </layout>

                  </appender>         

                  <root>

                         <priority value="ALL" />

                         <appender-ref ref="LogFileAppender" />         

                  </root>

                  <category name="DesktopLogger.Form1"><priority value="ALL" /></category>         

           </log4net>

    </configuration>

    Please refer to http://www.codeproject.com/Articles/11328/Configure-Log4Net-for-Desktop-and-Web-Applications to see the code sample.

    Key/value pairs for the configuration can put as below:

    <appSettings>

        <add key="bean" value="AutoSize"/>

      </appSettings>

    If you need put them together. Please note that if there has configSections node, it should be placed in the first child nodes.

    <?xml version="1.0" encoding="utf-8" ?>

    <configuration>

           <configSections>

                  <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

           </configSections>

      <appSettings>

          <add key="bean" value="AutoSize"/>

      </appSettings>

           <log4net debug="false">

                  <appender name="LogFileAppender" type="log4net.Appender.FileAppender,log4net" >

                         <param name="File" value="c:\\hnguyen\\download\\log.txt" />

                         <param name="AppendToFile" value="true" />

                         <layout type="log4net.Layout.PatternLayout,log4net">

                               <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] &lt;%X{auth}&gt; - %m%n" />

                         </layout>

                  </appender>         

                  <root>

                         <priority value="ALL" />

                         <appender-ref ref="LogFileAppender" />         

                  </root>

                  <category name="DesktopLogger.Form1"><priority value="ALL" /></category>         

           </log4net>

    </configuration>


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 14, 2013 7:14 AM
    Moderator
  • Hi;

    I'm afraid you did not understand my question. I know what to write in the config file. My question is, where is the config file I place this in? There is no exchange.exe.config file. So what is the location and name of the config file?

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Monday, October 14, 2013 1:22 PM
  • Hi David,

    Log4net is a component can used by your application, but there is a premise that you must have the source code of the application. Because we need to put some code in the source code of the project. So if exchange.exe is an application provided by others and you don’t have the code, I think you could not add log feature into it.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, October 15, 2013 2:46 AM
    Moderator
  • Hi;

    Please read my original question. I am writing an AddIn for Exchange. So I do have the source code for my DLL. I have added log statements to my DLL.

    Where do I put the .config elements for my DLL when the DLL is called by Exchange?

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Tuesday, October 15, 2013 12:31 PM
  • Hi David,

    I’m sorry to misunderstand you. I have searched on internet about how to build add-in for Exchange, but find nothing except those API. Please refer to this reference http://msdn.microsoft.com/en-us/openspecifications/hh546844.aspx and check that can these API meet your requirement.

    By the way, if your meaning was build a custom add-in for Outlook. Please have a look at this http://msdn.microsoft.com/en-us/library/bb410039(v=office.12).aspx

    Hope these could help you and thank you for your understanding.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 16, 2013 3:30 AM
    Moderator
  • Hi Hetro;

    Unfortunately this does not answer my questions. To securely use a connection string, I need to put the connection string encrypted in the .config file.

    How can I do that when there is no app.exe.config file? Is there a way, for MyADdIn.dll to use MyAddIn.dll.config? If so, how?

    And if not, how can I do this?

    thanks - dave


    Who will win The Windward International Collegiate Programming Championships?

    Wednesday, October 16, 2013 10:19 PM
  • Hi David,

    Yes, we could add a MyADdIn.dll.config file to your dll project. But we could not use it like exe project. So we could put connection string into it and use another way to read the string. Please refer to http://social.msdn.microsoft.com/Forums/en-US/b247a443-bd21-4b9e-b55c-74cc2413eb28/edit-connectionstring-in-dllconfig-file?forum=csharpgeneral to see how to do this.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, October 17, 2013 1:43 AM
    Moderator
  • Bingo! That's what I need. Thank you.

    Who will win The Windward International Collegiate Programming Championships?

    Thursday, October 17, 2013 1:20 PM