none
Connection to Exchange diconnected when using VSTO Add-In RRS feed

  • Question

  • Hello.

    My name is Benjamin, I am new to Outlook Add-In Development...

    I am trying to develop a small Outlook 2016 Add-In via VSTO in Visual Studio Pro 2017.

    I was able to get the addin working. The Add-Ins task is only create a new message with a defined signature. Therefore I added some buttons on a ribbon tab and add this tab to the Outlook Explorer Window.

    Everythin works like a charm, besinde of the following problem:

    When activating this addin Outlook and its connection to the Exchange Server gets very unstable. Suddenly the connection was lost and Outlook shows "Disconnected" on the bottom status bar. (I am using a german outlook, and there it reads "Getrennt" instead of "Verbunden mit Microsoft Exchange", when everything was fine).

    I am sure, that the reason for this instability is the addin, because if I de-install the addin and start Outlook, everything is fine and stable.

    Can anyone give me some hints, where I have to start the search, why my addin causes these problems?

    Thank you

    Regards,
    Benjamin

    Monday, June 11, 2018 10:30 AM

Answers

  • This morning I found out, that the problem only occurs on my dev machine.

    I installed my add-in on a client machine for testing purposes. The add-in and Outlook worked normally.

    I could imagine, that the problem occurs, when debugging the add-in and facing some errors, so that the Outlook application could not be exited correctly, but exited via "debug stop" in de Visual Studio. In this case, propably, the ressources and sessions are not released and are still blocked by some processes.

    I also found out, that the standard "release timeout" for sessions on the exchange server is 2 hours by standard. So after some (long) time I can connect to Exchange even if the add-in is loaded. So I changed the session timeout time to a value, which microsoft recommends in another forum (5 minutes). The "orphaned" sessions on my dev machine should then be released sooner.

    I think the problem is solved.



    • Edited by BeSt79 Wednesday, June 13, 2018 12:14 PM
    • Proposed as answer by Terry Xu - MSFT Thursday, June 14, 2018 1:14 AM
    • Marked as answer by BeSt79 Monday, June 18, 2018 7:47 AM
    Wednesday, June 13, 2018 12:14 PM

All replies

  • Hello Benjamin,

    First, I would suggest you remove/disable all the other add-ins and then run the add-in to check if the issue is related to the add-in in case of any add-in conflict.

    If the issue  does related to the add-in. I'm wondering if parts code of the add-in caused the issue.

    I would suggest you create a new and blank Outlook add-in. Will the new add-in cause this issue?

    If the new add-in does not cause the issue, I think there must be some code in your add-in caused this issue. Then I would suggest you comment your code part by part to confirm which part caused this issue.

    Best Regards,

    Terry


    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.

    Tuesday, June 12, 2018 2:04 AM
  • Hi Terry

    Thank you very much for your message.

    I deactivated all other add-ins, so that only my own add-in is loaded. > Same error

    Then de-installed my add-in and started a completely new VSTO-project. I left this project empty. No code in it beside of the "standard" function sceleton:

    Public Class ThisAddIn
    
        Private Sub ThisAddIn_Startup() Handles Me.Startup
    
        End Sub
    
        Private Sub ThisAddIn_Shutdown() Handles Me.Shutdown
    
        End Sub
    
    End Class

    But when "debugging" this add-in (or installing it) and starting Outlook: > Same error.

    When showing the status window, the mentioned error code is: 0x80040115

    So I am - at the moment - unable to develop a VSTO Add-In. That is very disappointing, because we switched from another email server to Exchange with Outlook mailny BECAUSE of the possible add-in-development.

    Every help is very appreciated.

    Best regards

    Benjamin

    Tuesday, June 12, 2018 9:49 AM
  • I found out, that the ExchangeServer records an error relating to the number of sessions:

    Mapi session /o=OurDomain/ou=Exchange Administrative Group /cn=Recipients/cn=MyExchangeAccount with client type MoMT exceeded the maximum of 32 objects of type Session.

    Surely I could raise the number of possible objects of type Session, but that would not be constructive - I rather should find out, why my Outlook client requerst so much sessions when starting an completely empty add-in...

    Anybody any ideas?

    Thank you

    Benjamin 



    • Edited by BeSt79 Tuesday, June 12, 2018 11:55 AM
    Tuesday, June 12, 2018 11:54 AM
  • Hello BeSt79,

    What's session number if you do not add any add-ins? What's the session number if you load an add-in? Except custom add-ins, MS Outlook also provide some built-in add-ins. Will they create any more sessions?

    Best Regards,

    Terry


    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.

    Wednesday, June 13, 2018 10:06 AM
  • This morning I found out, that the problem only occurs on my dev machine.

    I installed my add-in on a client machine for testing purposes. The add-in and Outlook worked normally.

    I could imagine, that the problem occurs, when debugging the add-in and facing some errors, so that the Outlook application could not be exited correctly, but exited via "debug stop" in de Visual Studio. In this case, propably, the ressources and sessions are not released and are still blocked by some processes.

    I also found out, that the standard "release timeout" for sessions on the exchange server is 2 hours by standard. So after some (long) time I can connect to Exchange even if the add-in is loaded. So I changed the session timeout time to a value, which microsoft recommends in another forum (5 minutes). The "orphaned" sessions on my dev machine should then be released sooner.

    I think the problem is solved.



    • Edited by BeSt79 Wednesday, June 13, 2018 12:14 PM
    • Proposed as answer by Terry Xu - MSFT Thursday, June 14, 2018 1:14 AM
    • Marked as answer by BeSt79 Monday, June 18, 2018 7:47 AM
    Wednesday, June 13, 2018 12:14 PM
  • Hello Best79,

    Glad to hear that your issue has been resolved. I would suggest you mark your solution to close the thread. If you have any other issue, please feel free to post to let us know.

    Best Regards,

    Terry


    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.

    Thursday, June 14, 2018 1:16 AM