Open PAPIONbit opened 2 years ago
Could you paste the full exception message or upload the log file? /needinfo
/bugreport
Hi there!
We need a bit more information to really debug this issue. Can you add a "Report Bug" zip file here? You right click on our system tray icon and just go to report bug. Then drag the zipfile from your desktop onto the GitHub comment box in this issue. Thanks!
@franky920920
Hi, thank you for your attention.
Sure, But the scenario is so so simple, just set security access to read of a file on deny.
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.UnauthorizedAccessException: Access to the path 'C:\test.txt' is denied.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategy(FileStream fileStream, String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, Int64 preallocationSize)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.PowerToys.PreviewHandler.Monaco.MonacoPreviewHandlerControl.<>c__DisplayClass6_1`1.<<DoPreview>b__3>d.MoveNext()
--- End of stack trace from previous location ---
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
************** Loaded Assemblies **************
System.Private.CoreLib
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Private.CoreLib.dll
----------------------------------------
PowerToys.MonacoPreviewHandler
Assembly Version: 0.57.0.0
Win32 Version: 0.57.0.0
CodeBase: file:///C:/Program%20Files/PowerToys/modules/FileExplorerPreview/PowerToys.MonacoPreviewHandler.dll
----------------------------------------
PowerToys.PreviewHandlerCommon
Assembly Version: 0.57.0.0
Win32 Version: 0.57.0.0
CodeBase: file:///C:/Program%20Files/PowerToys/modules/FileExplorerPreview/PowerToys.PreviewHandlerCommon.dll
----------------------------------------
System.Runtime
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Runtime.dll
----------------------------------------
System.Drawing.Primitives
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Drawing.Primitives.dll
----------------------------------------
System.ComponentModel.TypeConverter
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.ComponentModel.TypeConverter.dll
----------------------------------------
System.Runtime.InteropServices
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Runtime.InteropServices.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 6.0.2.0
Win32 Version: 6.0.322.12307
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/System.Windows.Forms.dll
----------------------------------------
System.ComponentModel.Primitives
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.ComponentModel.Primitives.dll
----------------------------------------
System.Windows.Forms.Primitives
Assembly Version: 6.0.2.0
Win32 Version: 6.0.322.12307
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/System.Windows.Forms.Primitives.dll
----------------------------------------
System.Collections.Specialized
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Collections.Specialized.dll
----------------------------------------
System.Drawing.Common
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/System.Drawing.Common.dll
----------------------------------------
System.Diagnostics.TraceSource
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Diagnostics.TraceSource.dll
----------------------------------------
System.Collections
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Collections.dll
----------------------------------------
Microsoft.Win32.Primitives
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/Microsoft.Win32.Primitives.dll
----------------------------------------
System.Threading
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Threading.dll
----------------------------------------
System.ComponentModel.EventBasedAsync
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.ComponentModel.EventBasedAsync.dll
----------------------------------------
System.Threading.Thread
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Threading.Thread.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 6.0.322.12307
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/Accessibility.dll
----------------------------------------
Microsoft.Win32.SystemEvents
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/Microsoft.Win32.SystemEvents.dll
----------------------------------------
System.Collections.NonGeneric
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Collections.NonGeneric.dll
----------------------------------------
Microsoft.Web.WebView2.WinForms
Assembly Version: 1.0.1108.44
Win32 Version: 1.0.1108.44
CodeBase: file:///C:/Program%20Files/PowerToys/modules/FileExplorerPreview/Microsoft.Web.WebView2.WinForms.dll
----------------------------------------
Microsoft.Web.WebView2.Core
Assembly Version: 1.0.1108.44
Win32 Version: 1.0.1108.44
CodeBase: file:///C:/Program%20Files/PowerToys/modules/FileExplorerPreview/Microsoft.Web.WebView2.Core.dll
----------------------------------------
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/mscorlib.dll
----------------------------------------
PowerToys.Common.UI
Assembly Version: 0.57.0.0
Win32 Version: 0.57.0.0
CodeBase: file:///C:/Program%20Files/PowerToys/modules/FileExplorerPreview/PowerToys.Common.UI.dll
----------------------------------------
PowerToys.ManagedCommon
Assembly Version: 0.57.0.0
Win32 Version: 0.57.0.0
CodeBase: file:///C:/Program%20Files/PowerToys/modules/FileExplorerPreview/PowerToys.ManagedCommon.dll
----------------------------------------
netstandard
Assembly Version: 2.1.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/netstandard.dll
----------------------------------------
ControlzEx
Assembly Version: 5.0.0.0
Win32 Version: 5.0.1.15
CodeBase: file:///C:/Program%20Files/PowerToys/modules/FileExplorerPreview/ControlzEx.dll
----------------------------------------
PresentationCore
Assembly Version: 6.0.2.0
Win32 Version: 6.0.322.12402
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/PresentationCore.dll
----------------------------------------
PresentationFramework
Assembly Version: 6.0.2.0
Win32 Version: 6.0.322.12402
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/PresentationFramework.dll
----------------------------------------
WindowsBase
Assembly Version: 6.0.2.0
Win32 Version: 6.0.322.12402
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/WindowsBase.dll
----------------------------------------
DirectWriteForwarder
Assembly Version: 6.0.2.0
Win32 Version: 6,0,322,12402 @Commit: 560f243910f407df33fd5cdf06e2a857684f4bc7
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/DirectWriteForwarder.dll
----------------------------------------
System.Runtime.Extensions
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Runtime.Extensions.dll
----------------------------------------
System.Runtime.CompilerServices.VisualC
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Runtime.CompilerServices.VisualC.dll
----------------------------------------
System.Diagnostics.Debug
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Diagnostics.Debug.dll
----------------------------------------
Microsoft.Win32.Registry
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/Microsoft.Win32.Registry.dll
----------------------------------------
System.ObjectModel
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.ObjectModel.dll
----------------------------------------
System.ComponentModel
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.ComponentModel.dll
----------------------------------------
System.Xaml
Assembly Version: 6.0.2.0
Win32 Version: 6.0.322.12402
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/System.Xaml.dll
----------------------------------------
System.Private.Uri
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Private.Uri.dll
----------------------------------------
System.Configuration.ConfigurationManager
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/System.Configuration.ConfigurationManager.dll
----------------------------------------
System.Runtime.InteropServices.RuntimeInformation
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Runtime.InteropServices.RuntimeInformation.dll
----------------------------------------
System.Diagnostics.Process
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Diagnostics.Process.dll
----------------------------------------
System.Memory
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Memory.dll
----------------------------------------
System.Xml.ReaderWriter
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Xml.ReaderWriter.dll
----------------------------------------
System.Private.Xml
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Private.Xml.dll
----------------------------------------
System.Net.WebClient
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Net.WebClient.dll
----------------------------------------
System.Net.Primitives
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Net.Primitives.dll
----------------------------------------
System.Net.Requests
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Net.Requests.dll
----------------------------------------
System.Net.WebHeaderCollection
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Net.WebHeaderCollection.dll
----------------------------------------
System.Text.Encoding.Extensions
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Text.Encoding.Extensions.dll
----------------------------------------
System.Linq
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Linq.dll
----------------------------------------
PresentationFramework-SystemXml
Assembly Version: 6.0.2.0
Win32 Version: 6.0.322.12402
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/PresentationFramework-SystemXml.dll
----------------------------------------
System.Threading.ThreadPool
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Threading.ThreadPool.dll
----------------------------------------
System.Text.Json
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Text.Json.dll
----------------------------------------
System.Numerics.Vectors
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Numerics.Vectors.dll
----------------------------------------
System.Runtime.CompilerServices.Unsafe
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Runtime.CompilerServices.Unsafe.dll
----------------------------------------
PowerToys.Settings.UI.Lib
Assembly Version: 0.57.0.0
Win32 Version: 0.57.0.0
CodeBase: file:///C:/Program%20Files/PowerToys/modules/FileExplorerPreview/PowerToys.Settings.UI.Lib.dll
----------------------------------------
System.IO.Abstractions
Assembly Version: 12.0.0.0
Win32 Version: 12.2.5.15321
CodeBase: file:///C:/Program%20Files/PowerToys/modules/FileExplorerPreview/System.IO.Abstractions.dll
----------------------------------------
System.Security.AccessControl
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Security.AccessControl.dll
----------------------------------------
System.Collections.Concurrent
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Collections.Concurrent.dll
----------------------------------------
System.Reflection.Emit.Lightweight
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Reflection.Emit.Lightweight.dll
----------------------------------------
System.Reflection.Primitives
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Reflection.Primitives.dll
----------------------------------------
System.Reflection.Emit.ILGeneration
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Reflection.Emit.ILGeneration.dll
----------------------------------------
System.Text.Encodings.Web
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Text.Encodings.Web.dll
----------------------------------------
System.Runtime.Intrinsics
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Runtime.Intrinsics.dll
----------------------------------------
PowerToys.ManagedTelemetry
Assembly Version: 0.57.0.0
Win32 Version: 0.57.0.0
CodeBase: file:///C:/Program%20Files/PowerToys/modules/FileExplorerPreview/PowerToys.ManagedTelemetry.dll
----------------------------------------
System.Diagnostics.Tracing
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Diagnostics.Tracing.dll
----------------------------------------
System.Threading.Tasks
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Threading.Tasks.dll
----------------------------------------
System.Drawing
Assembly Version: 6.0.2.0
Win32 Version: 6.0.322.12307
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.WindowsDesktop.App/6.0.3/System.Drawing.dll
----------------------------------------
System.Runtime.Loader
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Runtime.Loader.dll
----------------------------------------
System.Diagnostics.StackTrace
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Diagnostics.StackTrace.dll
----------------------------------------
System.Reflection.Metadata
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Reflection.Metadata.dll
----------------------------------------
System.Collections.Immutable
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Collections.Immutable.dll
----------------------------------------
System.Diagnostics.FileVersionInfo
Assembly Version: 6.0.0.0
Win32 Version: 6.0.322.12309
CodeBase: file:///C:/Program%20Files/dotnet/shared/Microsoft.NETCore.App/6.0.3/System.Diagnostics.FileVersionInfo.dll
----------------------------------------
************** JIT Debugging **************
cc: @Aaron-Junker fyi
Some needed info. Do the other preview handlers (.md or .svg) suffer from this same issue?
/needinfo
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 5 days. It will be closed if no further activity occurs within 5 days of this comment.
@jaimecbernardo
Some needed info. Do the other preview handlers (.md or .svg) suffer from this same issue?
No as i tried, just developer file preview
(I think if there be a windows 10 it is easy to try)
Microsoft PowerToys version
"0.57.0.0"
Running as admin
Area(s) with issue?
Developer file preview
Steps to reproduce
When windows explorer preview pane is on, while selecting text files with bad security like deny Full control to Everyone, or there is no User Group in list except System, Microsoft .Net will show an unexpected error.
Windows 10 LTSC 21H2 19044.1586
✔️ Expected Behavior
Handle error by showing a message in preview area like "No access to file. Check Properties > Security > ..."
❌ Actual Behavior
Show an Error:![image](https://user-images.githubusercontent.com/47592258/161493216-daa48bf4-60ed-4f55-a5f7-40f716840539.png)
Other Software
No response