locked
Config File And VsPackage RRS feed

  • Question

  • Hello everyone, i am working on Static Analyze tool. My application has config file, which contains next lines:

    <?xml version="1.0" encoding="utf-8" ?> 
     <configuration> 
       <runtime> 
        <gcServer enabled="true" /> 
      </runtime> 
    </configuration> 
    
    gcServer improve my app perfomance. It works fine in standalone application. But, when i try to create Vspackage addin (to integrate my app in Visual Studio 2010), this lines has no any effects. How i can solve this problem? Sorry for my bad English.
    Friday, August 10, 2012 12:57 PM

Answers

  • DLLs do not have config files.  Only EXEs do.  You cannot change any configuration info on the host without modifying the host's config file.  .NET does not support loading per-DLL configurations.  The best you can do is load a .config file as a normal XML file (or even using the Configuration class) but you can't change any of the .NET runtime's properties as the app has already done all that work.  You can just access your custom sections.

    Michael Taylor - 8/10/2012
    http://msmvps.com/blogs/p3net

    • Marked as answer by Bob Shen Tuesday, August 14, 2012 8:07 AM
    Friday, August 10, 2012 2:30 PM
  • "CoolDadTx", thanks, i solved this problem by another way. In vspackage i create new process and pass him a Solution Path as a parameter. This works.
    • Marked as answer by Bob Shen Tuesday, August 14, 2012 8:07 AM
    Friday, August 10, 2012 5:06 PM

All replies

  • DLLs do not have config files.  Only EXEs do.  You cannot change any configuration info on the host without modifying the host's config file.  .NET does not support loading per-DLL configurations.  The best you can do is load a .config file as a normal XML file (or even using the Configuration class) but you can't change any of the .NET runtime's properties as the app has already done all that work.  You can just access your custom sections.

    Michael Taylor - 8/10/2012
    http://msmvps.com/blogs/p3net

    • Marked as answer by Bob Shen Tuesday, August 14, 2012 8:07 AM
    Friday, August 10, 2012 2:30 PM
  • "CoolDadTx", thanks, i solved this problem by another way. In vspackage i create new process and pass him a Solution Path as a parameter. This works.
    • Marked as answer by Bob Shen Tuesday, August 14, 2012 8:07 AM
    Friday, August 10, 2012 5:06 PM