{"record":{"id":"2d1226f654802bd4","repo":"stride3d/stride","slug":"microsoft-pix-not-found-under-programfilespath","errorCode":null,"errorMessage":"Microsoft PIX not found under \"{programFilesPath}\".","messagePattern":"Microsoft PIX not found under \"(.+?)\"\\.","errorType":"exception","errorClass":"DirectoryNotFoundException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Graphics/Direct3D12/WinPixNative.cs","lineNumber":88,"sourceCode":"    {\n        IntPtr moduleHandle = GetModuleHandle(CapturerDllName);\n        if (moduleHandle == IntPtr.Zero)\n        {\n            LoadLibrary(GetLatestWinPixGpuCapturerPath());\n        }\n\n        //\n        // Helper to locate the latest installed \"WinPixGpuCapturer.dll\".\n        //\n        static string GetLatestWinPixGpuCapturerPath()\n        {\n            string programFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);\n            if (string.IsNullOrEmpty(programFilesPath))\n                throw new DirectoryNotFoundException(\"Could not locate \\\"Program Files\\\" folder.\");\n\n            string pixInstallationPath = Path.Combine(programFilesPath, \"Microsoft PIX\");\n            if (!Directory.Exists(pixInstallationPath))\n                throw new DirectoryNotFoundException($\"Microsoft PIX not found under \\\"{programFilesPath}\\\".\");\n\n            string newestVersionFound = null;\n\n            // Enumerate all subdirectories, looking for the one with the highest version number\n            foreach (var dir in Directory.EnumerateDirectories(pixInstallationPath))\n            {\n                var dirName = Path.GetFileName(dir);\n                if (string.IsNullOrEmpty(dirName))\n                    continue;\n\n                if (newestVersionFound is null || string.CompareOrdinal(newestVersionFound, dirName) < 0)\n                {\n                    newestVersionFound = dirName;\n                }\n            }\n\n            if (string.IsNullOrEmpty(newestVersionFound))\n                throw new InvalidOperationException(\"No PIX installation found.\");","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Graphics/Direct3D12/WinPixNative.cs#L70-L106","documentation":"Thrown by WinPixNative.LoadPixGpuCapturer when the Program Files folder resolves but the subdirectory \"Microsoft PIX\" does not exist there — i.e. PIX is not installed (or installed to a non-standard location), so WinPixGpuCapturer.dll cannot be found.","triggerScenarios":"Requesting a PIX GPU capture while Microsoft PIX is not installed in C:\\Program Files\\Microsoft PIX — e.g. fresh dev machines, only the standalone PIX app installed elsewhere, or PIX removed after an update.","commonSituations":"New workstations without PIX; PIX installed per-user (not under Program Files); running the capture-enabled debug build on a colleague's or CI machine that lacks PIX.","solutions":["Install Microsoft PIX (from the official PIX site) so \"<ProgramFiles>\\Microsoft PIX\" exists.","Verify PIX was installed machine-wide and not only to a per-user/alternate directory.","Disable PIX GPU capture when PIX is not installed, or wrap the capture setup in try/catch for DirectoryNotFoundException.","Set/keep the %ProgramFiles% environment variable intact so the combined path resolves."],"exampleFix":"// before\nGraphicsDeviceFactory.EnableGPUCaptureAssertions = true; // crashes if PIX missing\n// after\ntry { GraphicsDeviceFactory.EnableGPUCaptureAssertions = true; }\ncatch (DirectoryNotFoundException) { /* PIX not installed; skip capture */ }","handlingStrategy":"fallback","validationCode":"var pixDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), \"Microsoft PIX\");\nif (!Directory.Exists(pixDir))\n{\n    log.Warn(\"Microsoft PIX not installed; GPU capture disabled\");\n    return;\n}","typeGuard":"bool IsPixInstalled() =>\n    OperatingSystem.IsWindows()\n    && Directory.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), \"Microsoft PIX\"));","tryCatchPattern":"try { WinPixNative.Initialize(); }\ncatch (DirectoryNotFoundException ex) { log.Warn(\"Install Microsoft PIX for GPU capture: \" + ex.Message); }","preventionTips":["Install Microsoft PIX on every machine where GPU capture is expected to work.","Check PIX presence before enabling capture flags in debug builds.","Keep capture enablement behind a config flag that is off on machines without PIX."],"tags":["windows","pix","gpu-capture","installation-missing"],"backgroundTag":"directory-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}