locked
Enabling server garbage collection in a VSTO Excel document level add-in RRS feed

  • Question

  • Is it possible to enable the server garbage collection in a VSTO document level add-in for Excel? I'm using VS2010 with a Excel 2010 Workbook project and added an app.config to the project with:

    <configuration>
      <runtime>
        <gcServer enabled="true"/>
      </runtime>
    </configuration>

    This creates the ExcelWorkbook.dll.config with the setting but checking System.Runtime.GCSettings.IsServerGC at runtime reports false.

    When I did the same thing in a console, WPF, or Forms application project, IsServerGC was true and working. Trying the same thing in VS2015 also produced the same results.

    Wednesday, December 14, 2016 8:45 PM

All replies

  • Hello,

    You need to create or modify the .config file for the host application, not document.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Wednesday, December 14, 2016 10:15 PM
  • Can that be done for Excel and VSTO?  I've tried making an excel.exe.config in the office directory but that didn't do anything.
    Thursday, December 15, 2016 10:40 PM
  • Hi,

    The configuration to set gcServer does not work for me too.

    I have checked the related documents and searched a lot, but still failed to find any document about the configuration of Office server garbage collection. I think we could not enable it for Office.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 19, 2016 7:14 AM