none
Cannot debug VSTO add-in on this machine, but works on others and in production. RRS feed

  • Question

  • I have a VSTO add-in that works perfectly when running normally. However whenever I try to debug, PowerPoint closes and debugging stops shortly after starting up. No exception thrown, no messages.

    Seems to be a problem with the environment on this machine because this isn't experienced on other developer machines.

    Any thoughts on why the debugger is crashing on this particular machine or how to diagnose?


    -b

    Thursday, August 29, 2019 12:40 AM

All replies

  • Hi Bradley Mauk,

    Welcome to MSDN forum.

    According your description, please check whether all PowerPoint Processes stopped before you debug your  VSTO for PowerPoint. 

    And then please install VSTO runtime: https://www.microsoft.com/en-us/download/details.aspx?id=56961

    If it persists, I suggest you could repair your PowerPoint and visual studio.

    Any feedback will be expected.

    Best Regards,

    Dylan


    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, August 29, 2019 6:05 AM
  • The VSTO runtime is already installed, no PowerPoint processes are running prior to beginning to debug.

    I can begin to debug, PowerPoint starts and i can hit breakpoints etc, but after about 5-7 seconds, the debugger just stops and PowerPoint closes.  No exception blocks are hit.  Again, only occurs on this particular machine.


    -b

    Thursday, August 29, 2019 2:56 PM
  • I seem to have isolated the specific issue on this machine, but i cannot explain it.

    The add-in has a WPF control in a custom action pane, hosted by a ElementHost on the windows form.

    If I comment out all the WPF so that WindowsFormsIntegration, PresentationCore, etc are removed from the solution, then I can debug on this machine.  Note:  I don't need to do this on other machines.

    Any thoughts why this DLL might be crashing the debugger?


    -b

    Thursday, August 29, 2019 4:58 PM
  • Hi Bradley Maulk,

    Thank you for reply.

    In order to further diagnose this issue, please try to run fuslogvw (https://docs.microsoft.com/en-us/dotnet/framework/tools/fuslogvw-exe-assembly-binding-log-viewer) to capture these assembly binding failures while VSTO is running.

    Any feedback will be expected.

    Best Regards,

    Dylan


    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

    Friday, August 30, 2019 11:09 AM
  • Now I seem to be getting somewhere.  Below is the log, but not sure how to fix it.

    I do have an app.config file, so dont know why that message is coming up.  Any thoughts as to what is happening?

    *** Assembly Binder Log Entry  (9/1/2019 @ 10:01:03 PM) ***
    
    The operation failed.
    Bind result: hr = 0x80070002. The system cannot find the file specified.
    
    Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
    Running under executable  C:\Program Files\Microsoft Office\root\Office16\powerpnt.exe
    --- A detailed error log follows. 
    
    === Pre-bind state information ===
    LOG: DisplayName = System.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
     (Fully-specified)
    LOG: Appbase = file:///C:/Program Files/Brad Mauk/PowerPoint Utilities/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = powerpnt.exe
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: No application configuration file found.
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
    LOG: Post-policy reference: System.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
    LOG: GAC Lookup was unsuccessful.
    LOG: Attempting download of new URL file:///C:/Program Files/Brad Mauk/PowerPoint Utilities/System.XmlSerializers.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files/Brad Mauk/PowerPoint Utilities/System.XmlSerializers/System.XmlSerializers.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files/Brad Mauk/PowerPoint Utilities/System.XmlSerializers.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files/Brad Mauk/PowerPoint Utilities/System.XmlSerializers/System.XmlSerializers.EXE.
    LOG: All probing URLs attempted and failed.
    


    -b

    Monday, September 2, 2019 2:05 AM
  • Hi Bradley Mauk,

    Thank you for feedback.

    According to your log, please try to enable "Enable just my code" in Options/Debugging/General, then re-debug it. 

    Please refer this similar issue: Strange XmlSerializer error, maybe it could help you.

    Best Regards,

    Dylan


    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, September 2, 2019 6:55 AM
  • "Enable Just My Code" has been enabled this whole time..

    -b

    Monday, September 2, 2019 12:19 PM
  • Here is what i have done so far.  I have created a very simple solution where i reproduce the problem:

    I created a PowerPoint VSTO add-in with 2 controls:  A window forms control that only contains an ElementHost that hosts the a WPF control.  No other code.

    About 5 seconds after debugging, the debugger stops.

    fuslogvw give me the following below error.  "Just my Code" is enabled.

    Thanks for the help thus far in trying to figure this out...

    *** Assembly Binder Log Entry  (9/1/2019 @ 10:01:03 PM) ***
    
    The operation failed.
    Bind result: hr = 0x80070002. The system cannot find the file specified.
    
    Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
    Running under executable  C:\Program Files\Microsoft Office\root\Office16\powerpnt.exe
    --- A detailed error log follows. 
    
    === Pre-bind state information ===
    LOG: DisplayName = System.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
     (Fully-specified)
    LOG: Appbase = file:///C:/Program Files/Brad Mauk/PowerPoint Utilities/
    LOG: Initial PrivatePath = NULL
    LOG: Dynamic Base = NULL
    LOG: Cache Base = NULL
    LOG: AppName = powerpnt.exe
    Calling assembly : (Unknown).
    ===
    LOG: This bind starts in default load context.
    LOG: No application configuration file found.
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
    LOG: Post-policy reference: System.XmlSerializers, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
    LOG: GAC Lookup was unsuccessful.
    LOG: Attempting download of new URL file:///C:/Program Files/Brad Mauk/PowerPoint Utilities/System.XmlSerializers.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files/Brad Mauk/PowerPoint Utilities/System.XmlSerializers/System.XmlSerializers.DLL.
    LOG: Attempting download of new URL file:///C:/Program Files/Brad Mauk/PowerPoint Utilities/System.XmlSerializers.EXE.
    LOG: Attempting download of new URL file:///C:/Program Files/Brad Mauk/PowerPoint Utilities/System.XmlSerializers/System.XmlSerializers.EXE.
    LOG: All probing URLs attempted and failed.


    -b

    Tuesday, September 3, 2019 12:49 AM
  • Hi Bradley Mauk,

    Thank you for reply.

    Please open your "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config", then check if it in it


    If no, please copy the framework64\v4.0.30319 folder which is from other computer or download .NET Framework V4.0.

    Not sure if repair VS could help, but it might be worthy trying if it's possible for you. 

    Best Regards,

    Dylan


    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, September 3, 2019 6:32 AM
  • OK.  I did a repair of both VS and Office.

    The good news is that i am no longer seeing the XmlSerializers bind error in fuslogvw (using setting: Log Bind failures to disk).  The bad news is that i still cannot debug the add-in when it has any WPF code in it.  Comment out the WPF code, all good debugging teh add-in works fine.  I can debug regular WPF applications otherwise though.

    So the XmlSerializers appears to have been a red-herring. 

    Not sure where to begin to look next...

    .b


    -b

    Thursday, September 5, 2019 7:44 PM
  • Hi Bradley Mauk,

    Sorry for delay in reply.

    It seems to be strange. Not sure if it is caused by conficted by other 3rd plugins, software or framework, I recommend you could try to make a clean installation for VS and PowerPoint on your machine. Then try to re-debug it.

    Best Regards,

    Dylan


    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

    Sunday, September 8, 2019 2:39 PM