Developer Portal Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Visual Studio crash / TwinCAT XAE crash

    English 🠦 Deutsch
     
    If you encounter a Visual Studio crash / TwinCAT XAE crash it usually looks like this or it may be even closed without message box:
    "Microsoft Visual Studio has stopped working"
     
    SteffenR_1-1643016812638.png

    There are some solutions for known problems:

    1. Do not use Visual Studio 2010 and Visual Studio 2013 anymore. Update to a newer Visual Studio version that is supported by your TwinCAT version (see below). BCI recommends to use TcXaeShell which is currently a Visual Studio Shell 2017 labeled by Beckhoff. Since now there is no separate installer for TcXaeShell. Therefore you should select installation of TcXaeShell during setup of TwinCAT 3.1.4024. If you have already the latest TwinCAT version without TcXaeShell try to start the Remote Manager setup.

      A project can be updated by opening it manually with the new Visual Studio / TcXaeShell version. Then select the solution in the solution explorer and explicitly save it:
      SteffenR_3-1633444787696.png

      Following Visual Studio versions are supported:
      - TwinCAT 3.1.4016.28 supports up to Visual Studio 2013, no TcXaeShell
      - TwinCAT 3.1.4020.28 supports up to Visual Studio 2015, no TcXaeShell
      - TwinCAT 3.1.4020.56 supports up to Visual Studio 2019*
      - TwinCAT 3.1.4022.25-32 support up to Visual Studio 2019*
      - TwinCAT 3.1.4024.12-20 support up to Visual Studio 2019*

      *) As of now (October 2021) the search function of Visual Studio 2019 can't jump into SFC actions. Therefore BCI recommends to use TcXaeShell or Visual Studio 2017.
       
    2. If you still want to use Visual Studio 2013 you must install Visual Studio 2013 Update 5. This update solves many known crash causes. The update has several gigabyte because it also installs some other Microsoft components like Windows Phone SDK.
      More information:
      https://docs.microsoft.com/en-us/visualstudio/releasenotes/vs2013-update5-vs
      SteffenR_2-1633444124788.png
       
    3. SFC chains that have been edited with TwinCAT 3.1.4024 cannot be edited with TwinCAT 3.1.4022 anymore. If a TcPOU file contains the GUID 6ecff51c-9b8f-4338-aab0-67c2b31b07e9 TwinCAT XAE 3.1.4022 will crash when editing this SFC functionblock.
       
    4. Window docking in Visual Studio causes a crash:
      SteffenR_0-1633506405244.pngSteffenR_1-1633444071743.png
       

      This can be fixed depending on your Visual Studio version:

      1. TcXaeShell

        1. Close TcXaeShell / Visual Studio
        2. Open the path C:\Program Files (x86)\Beckhoff\TcXaeShell\Common7\IDE
        3. Create a backup of the file TcXaeShell.exe.config
          SteffenR_4-1633445134135.png
        4. Start Notepad++ with administrator rights ("run as administrator")
        5. Open TcXaeShell.exe.config
        6. Search for the key word <AppContextSwitchOverrides
        7. Add the red code (do not forget the semicolon!):
                <AppContextSwitchOverrides value="Switch.System.Threading.ThrowExceptionIfDisposedCancellationTokenSource=false;Switch.System.Windows.Forms.DoNotSupportSelectAllShortcutInMultilineTextBox=false;Switch.UseLegacyAccessibilityFeatures=false;Switch.UseLegacyAccessibilityFeatures.2=false;Switch.UseLegacyAccessibilityFeatures.3=false;Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix=true;Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix=true" />
        8. Save and close the file
        9. Docking windows should work again without crashing
           
      2. Visual Studio 2019
        Use update function of Visual Studio
      3. Visual Studio 2017
        Use update function of Visual Studio
      4. Visual Studio 2015
        See description of TcXaeShell, but instead of TcXaeShell.exe.config edit this file:
        C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe.config
      5. Visual Studio 2013
        See description of TcXaeShell, but instead of TcXaeShell.exe.config edit this file:
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config
        Additionally this file does not yet include an element called AppCOntextSwitchOverrides. That means the whole XML element must be added with the new attributes:
              <AppContextSwitchOverrides value="Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix=true;Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix=true" />
        SteffenR_3-1633506482282.png

     

     
    Deutsch 🠦 English
     
    Ein Absturz von Visual Studio / TwinCAT XAE sieht wie folgt aus oder es wird sogar ohne Meldungsfenster geschlossen:
    "Microsoft Visual Studio has stopped working"
    SteffenR_2-1643016833422.png

    Es gibt einige Lösungen für bekannte Probleme:

    1. Kein Visual Studio 2010 und Visual Studio 2013 mehr verwenden. Auf eine neuere Visual Studio Version aktualisieren, die von der eingesetzten TwinCAT-Version unterstützt wird (siehe unten). BCI empfiehlt TcXaeShell, das aktuell ein von Beckhoff gelabeltes Visual Studio Shell 2017. Bisher gibt es kein separates Setup für TcXaeShell. Deshalb sollte man die TcXaeShell-Installation während der Installation von TwinCAT 3.1.4024 auswählen. Wenn die neueste TwinCAT-Version ohne TcXaeShell bereits installiert ist, kann man ein Remote Manager Setup starten.

      Ein Projekt kann aktualisiert werden, indem man es manuell mit der neuen Visual Studio / TcXaeShell Version öffnet. Dann die Projektmappe im Projektmappen-Explorer auswählen und explizit speichern:
      SteffenR_3-1633444787696.png

      Folgende Visual Studio Versionen werden unterstützt:
      - TwinCAT 3.1.4016.28 unterstützt bis Visual Studio 2013, kein TcXaeShell
      - TwinCAT 3.1.4020.28 unterstützt bis Visual Studio 2015, kein TcXaeShell
      - TwinCAT 3.1.4020.56 unterstützt bis Visual Studio 2019*
      - TwinCAT 3.1.4022.25-32 unterstützt bis Visual Studio 2019*
      - TwinCAT 3.1.4024.12-20 unterstützt bis Visual Studio 2019*

      *) Aktuell (Oktober 2021) kann die Suchfunktion von Visual Studio 2019 nicht in Schrittketten Aktionen hinein springen. BCI empfiehlt deshalb TcXaeShell oder Visual Studio 2017.

    2. Wenn Sie weiterhin Visual Studio 2013 einsetzen wollen, installieren Sie Visual Studio 2013 Update 5. Dieses Update behebt viele Absturzursachen. Das Update ist mehrere Gigabyte groß, weil es auch andere Microsoft Komponenten wie Windows Phone SDK installiert.
      Weitere Informationen:
      https://docs.microsoft.com/de-de/visualstudio/releasenotes/vs2013-update5-vs
      SteffenR_2-1633444124788.png
       
    3. SFC Schrittketten, die mit TwinCAT 3.1.4024 bearbeitet wurden, können nicht mehr mit TwinCAT 3.1.4022 bearbeitet werden. Wenn eine TcPOU-Datei die GUID 6ecff51c-9b8f-4338-aab0-67c2b31b07e9 enthält, stürzt TwinCAT XAE 3.1.4022 ab beim Bearbeiten dieses SFC Funktionsblocks.
       
    4. Das Andocken von Fenstern (Tabs) in Visual Studio verursacht einen Absturz:
       
      SteffenR_1-1633444071743.png
       

      Dies kann in Abhängigkeit der Visual Studio Version behoben werden:

      1. TcXaeShell

        1. TcXaeShell / Visual Studio schließen
        2. Den Pfad C:\Program Files (x86)\Beckhoff\TcXaeShell\Common7\IDE öffnen
        3. Eine Sicherung der Datei TcXaeShell.exe.config erstellen
          SteffenR_4-1633445134135.png
        4. Notepad++ mit Administrator-Rechten starten ("run as administrator")
        5. TcXaeShell.exe.config öffnen
        6. Nach dem Schlüsselwort <AppContextSwitchOverrides suchen
        7. Den roten Code hinzufügen (Semikolon nicht vergessen!):
                <AppContextSwitchOverrides value="Switch.System.Threading.ThrowExceptionIfDisposedCancellationTokenSource=false;Switch.System.Windows.Forms.DoNotSupportSelectAllShortcutInMultilineTextBox=false;Switch.UseLegacyAccessibilityFeatures=false;Switch.UseLegacyAccessibilityFeatures.2=false;Switch.UseLegacyAccessibilityFeatures.3=false;Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix=true;Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix=true" />
        8. Die Datei speichern und schließen
        9. Andocken von Fenstern sollte wieder funktionieren ohne abzustürzen
           
      2. Visual Studio 2019
        Update-Funktion von Visual Studio verwenden
      3. Visual Studio 2017
        Update-Funktion von Visual Studio verwenden
      4. Visual Studio 2015
        Siehe Beschreibung von TcXaeShell, aber anstatt TcXaeShell.exe.config diese Datei bearbeiten:
        C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe.config
      5. Visual Studio 2013
        Siehe Beschreibung von TcXaeShell, aber anstatt TcXaeShell.exe.config diese Datei bearbeiten:
        C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config
        Zusätzlich enthält diese Datei noch nicht das Element namens AppContextSwitchOverrides. Das bedeutet, das ganze XML-Element mit den neuen Attributen muss hinzugefügt werden:
              <AppContextSwitchOverrides value="Switch.System.Windows.Interop.MouseInput.OptOutOfMoveToChromedWindowFix=true;Switch.System.Windows.Interop.MouseInput.DoNotOptOutOfMoveToChromedWindowFix=true" />
        SteffenR_1-1633506412843.png

     

    Version history
    Last update:
    ‎01-24-2022 10:34 AM
    Updated by:
    Contributors
    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist