diagnosticshub.scriptedsandboxplugin.dll Error in Windows 10 and 11: Visual Studio diagnostic collector startup

A Visual Studio profiling session fails during startup and logs diagnosticshub.scriptedsandboxplugin.dll.
The Windows file inventory identifies diagnosticshub.scriptedsandboxplugin.dll as Microsoft (R) Diagnostics Hub Scripted Sandbox Plugin. Capture the actual error, file path and Windows build before making changes.
Check where the error occurs
Start a small local profiling session in a trusted sample app. Compare with the originally selected tool and extensions, and keep the collection error and target architecture.
Repair the affected feature
Use supported Visual Studio and workload updates. If only one tool is affected, check Microsoft's profiling error guidance. Keep its collection isolation and security settings in place.
If Windows reports corruption of a protected system file, use Microsoft’s system file repair procedure. Obtain software and drivers through Windows Update or the applicable publisher.
Verify the repair
Start the same profiling tool against the original trusted project, capture a brief supported session and confirm it can display the results.
See the publisher’s guidance, the exact Windows file record, and the related PC Repair Atlas guide.