The user control that is opened in custom task pane of outlook plugin, doesn't get disposed when the pane is closed

V K

I am developing an outlook plugin.I added a button in outlook toolbar, and when the user clicks that button, a webservice is called.Depending upon the result of that webservice a usercontrol is loaded in a custom task pane.When a user closes the custom task pane, I call the dispose method on the user control.I also dispose the child control of this user control in its disposed event and removed the custom task pane from the customtaskpanes list.But the memory is not released.I also disposed the custom task pane.But nothing happened.So, is it a problem with my coding, or is it a problem with outlook?I am working with winforms on .net framework 3.5.The memory taken by outlook keeps on increasing whenever I press the button.

Benoit Patra

It is hard to tell if a memory leak occurs without any code sample. Keep in mind that analyzing managed memory can be tricky...

However, my suggestion is that you probably should not dispose your VSTO task pane controls manually. If the user clicks the hide task pane, the task pane is not "destroyed" and you should not unregister it. Its Visible property is set to false. See sample code below in my Startup.addin.cs that enables to Toggle the TaskPane visibility.

        public const string productName = "myMillionDollarAddin";
        private void RegisterTaskPane()
        {
            var tskControl = new TaskPaneControl();
            CustomTaskPane taskPane = this.CustomTaskPanes.Add(tskControl, productName);
            taskPane.Visible = true;
        }

        public void ShowHideTaskPane()
        {
            var taskPane = this.CustomTaskPanes.FirstOrDefault(ctp => ctp.Title == productName);
            if (taskPane == null)
            {
                RegisterTaskPane();
            }
            else
            {
                var visibility = taskPane.Visible;
                taskPane.Visible = !visibility;
            }
        }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

NetOffice - Custom Task Pane in a Appointment window in Outlook

From Dev

Outlook App for Office task pane

From Dev

HTML content in Custom Task Pane Outlook VSTO ADD in

From Dev

Excel Custom Task Pane not showing

From Dev

Apps for Office: my task pane app doesn't get the licensing '?et=' license token

From Dev

Apps for Office: my task pane app doesn't get the licensing '?et=' license token

From Dev

Outlook 365 vertical task pane in read mode?

From Dev

Outlook add-in pinnable task pane

From Dev

Add winform addin to Custom task pane in Word

From Dev

Create Task Pane Office Add-In for Outlook 2016

From Dev

Outlook 2010 messages pane

From Dev

Adding a Custom Task Pane to Word (Without using VSTO)

From Dev

Create Excel 2007 or 2010 custom task pane using VBA

From Dev

Create Excel 2007 or 2010 custom task pane using VBA

From Dev

VSTO override Excel hotkeys inside custom task pane

From Dev

VSTO-Excel Custom Task Pane AutoResize based on Screen Resolution

From Dev

Why doesn't Mutex get released when disposed?

From Dev

JavaFX custom MasterDetail pane

From Dev

How to get document share link using OfficeJs in a task pane app?

From Dev

Get pane # of each pane in a window from a script?

From Dev

Get pane # of each pane in a window from a script?

From Dev

Keep Outlook App pane open

From Dev

JavaFx - Get the coordinates(x,y) of a node or control whose parent is not a Pane

From Dev

Display flagged email in task pane

From Dev

LayoutManager doesn't work well with a background-image content pane

From Dev

Visio doesn't show shape's icons on Shapes pane

From Dev

Can outlook web add-in entry page(taskpaneurl) know which task pane button triggers the visit?

From Dev

JavaFX 2 Creating a Custom Pane

From Dev

Fatal execution error when a file is opened, closed and disposed multiple times in C#

Related Related

  1. 1

    NetOffice - Custom Task Pane in a Appointment window in Outlook

  2. 2

    Outlook App for Office task pane

  3. 3

    HTML content in Custom Task Pane Outlook VSTO ADD in

  4. 4

    Excel Custom Task Pane not showing

  5. 5

    Apps for Office: my task pane app doesn't get the licensing '?et=' license token

  6. 6

    Apps for Office: my task pane app doesn't get the licensing '?et=' license token

  7. 7

    Outlook 365 vertical task pane in read mode?

  8. 8

    Outlook add-in pinnable task pane

  9. 9

    Add winform addin to Custom task pane in Word

  10. 10

    Create Task Pane Office Add-In for Outlook 2016

  11. 11

    Outlook 2010 messages pane

  12. 12

    Adding a Custom Task Pane to Word (Without using VSTO)

  13. 13

    Create Excel 2007 or 2010 custom task pane using VBA

  14. 14

    Create Excel 2007 or 2010 custom task pane using VBA

  15. 15

    VSTO override Excel hotkeys inside custom task pane

  16. 16

    VSTO-Excel Custom Task Pane AutoResize based on Screen Resolution

  17. 17

    Why doesn't Mutex get released when disposed?

  18. 18

    JavaFX custom MasterDetail pane

  19. 19

    How to get document share link using OfficeJs in a task pane app?

  20. 20

    Get pane # of each pane in a window from a script?

  21. 21

    Get pane # of each pane in a window from a script?

  22. 22

    Keep Outlook App pane open

  23. 23

    JavaFx - Get the coordinates(x,y) of a node or control whose parent is not a Pane

  24. 24

    Display flagged email in task pane

  25. 25

    LayoutManager doesn't work well with a background-image content pane

  26. 26

    Visio doesn't show shape's icons on Shapes pane

  27. 27

    Can outlook web add-in entry page(taskpaneurl) know which task pane button triggers the visit?

  28. 28

    JavaFX 2 Creating a Custom Pane

  29. 29

    Fatal execution error when a file is opened, closed and disposed multiple times in C#

HotTag

Archive