{"record":{"id":"617c7409d7ae0954","repo":"BornToBeRoot/NETworkManager","slug":"process-could-not-be-started-tigervnccontrol-xaml","errorCode":null,"errorMessage":"Process could not be started!","messagePattern":"Process could not be started!","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Source/NETworkManager/Controls/TigerVNCControl.xaml.cs","lineNumber":199,"sourceCode":"                        // Remove border etc.\n                        long style = (int)NativeMethods.GetWindowLong(_appWin, NativeMethods.GWL_STYLE);\n                        style &= ~(NativeMethods.WS_CAPTION | NativeMethods.WS_POPUP |\n                                   NativeMethods\n                                       .WS_THICKFRAME); // NativeMethods.WS_POPUP --> Overflow? (https://github.com/BornToBeRoot/NETworkManager/issues/167)\n                        NativeMethods.SetWindowLongPtr(_appWin, NativeMethods.GWL_STYLE, new IntPtr(style));\n\n                        IsConnected = true;\n\n                        // Resize embedded application & refresh\n                        // Requires a short delay because it's not applied immediately\n                        await Task.Delay(250);\n                        ResizeEmbeddedWindow();\n                    }\n                }\n            }\n            else\n            {\n                throw new Exception(\"Process could not be started!\");\n            }\n        }\n        catch (Exception ex)\n        {\n            if (!_closed)\n                // Use built-in message box because we have visual issues in the dragablz window\n                MessageBox.Show(ex.Message, Strings.Error, MessageBoxButton.OK, MessageBoxImage.Error);\n        }\n\n        IsConnecting = false;\n    }\n\n    private void Process_Exited(object sender, EventArgs e)\n    {\n        // This happens when the user exit the process\n        IsConnected = false;\n    }\n","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/BornToBeRoot/NETworkManager/blob/2780d65469917a296dbc15f206107d72e2d0115c/Source/NETworkManager/Controls/TigerVNCControl.xaml.cs#L181-L217","documentation":"TigerVNCControl.Connect() starts the TigerVNC viewer executable (vncviewer) via Process.Start and embeds its window. If Process.Start returns null — no process was created, typically because the configured ApplicationFilePath is missing or not executable — the control throws this generic Exception and shows the message in a message box.","triggerScenarios":"Process.Start(info) returns null in Connect() because the TigerVNC viewer executable path is missing, invalid, or blocked from execution.","commonSituations":"TigerVNC not installed or its path not configured in Settings > TigerVNC; vncviewer.exe moved/renamed after configuration; antivirus or software restriction policies blocking the viewer; portable deployment missing the external binary.","solutions":["Open Settings > TigerVNC and set the correct full path to vncviewer(.exe); confirm the file exists.","Install TigerVNC or re-download the viewer and update the configured path.","Check whether antivirus/AppLocker blocks the executable and whitelist it.","Reconnect/reopen the VNC tab so Connect() runs again with the fixed path."],"exampleFix":"// before\ninfo.FileName = _sessionInfo.ApplicationFilePath;\n// after (guard before constructing the control / calling Connect)\nif (!File.Exists(_sessionInfo.ApplicationFilePath))\n    MessageBox.Show($\"TigerVNC viewer not found: {_sessionInfo.ApplicationFilePath}\");","handlingStrategy":"validation","validationCode":"var path = sessionInfo.ApplicationFilePath;\nbool canStart = !string.IsNullOrWhiteSpace(path) && File.Exists(path);","typeGuard":"static bool HasExecutable(string path) => !string.IsNullOrWhiteSpace(path) && File.Exists(path) && Path.GetExtension(path).Equals(\".exe\", StringComparison.OrdinalIgnoreCase);","tryCatchPattern":"try\n{\n    await Connect();\n}\ncatch (Exception ex) when (ex.Message == \"Process could not be started!\")\n{\n    MessageBox.Show($\"TigerVNC viewer not found: {settings.TigerVNCPath}\", \"Error\");\n}","preventionTips":["Configure and verify the vncviewer path in Settings > TigerVNC before connecting.","Ensure TigerVNC is installed and the path survives application updates.","Whitelist the viewer in endpoint protection software on managed machines.","Add a preflight File.Exists check when loading VNC profiles."],"tags":["csharp","process-start","tigervnc","external-tool"],"backgroundTag":"command-not-found","analyzedSha":"2780d65469917a296dbc15f206107d72e2d0115c","analyzedAt":"2026-09-12T17:00:17.986Z","contentChangedAt":"2026-09-12T17:00:17.986Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}