Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Crashes on start (System.NotSupportedException, CAS policy) #247

Closed
david50407 opened this issue Jun 3, 2018 · 2 comments
Closed

Crashes on start (System.NotSupportedException, CAS policy) #247

david50407 opened this issue Jun 3, 2018 · 2 comments

Comments

@david50407
Copy link

david50407 commented Jun 3, 2018

Windows ver: Windows 10 Pro 1803, 17133.1
Version: 0.3.5 (zip) and Nightly built from AppVeyor (0.3.5-21-g3f1b943.zip)

QuickLook crashes on start, it appears systray icon and disappears soon.
This issue seems doesn't happened on UWP version (0.3.5, install from MS store)

The exception .Net throws:

System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. 
This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. 
If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

Log: (I extract zip to C:\Users\Davy\Applications\QuickLook\)

========2018/6/3 下午 05:02:23========
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\Davy\Applications\QuickLook\QuickLook.Plugin\QuickLook.Plugin.ArchiveViewer\QuickLook.Plugin.ArchiveViewer.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
檔案名稱: 'file:///C:\Users\Davy\Applications\QuickLook\QuickLook.Plugin\QuickLook.Plugin.ArchiveViewer\QuickLook.Plugin.ArchiveViewer.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
   於 System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   於 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   於 System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   於 System.Reflection.Assembly.LoadFrom(String assemblyFile)
   於 QuickLook.PluginManager.<LoadPlugins>b__11_0(String lib)
   於 System.Collections.Generic.List`1.ForEach(Action`1 action)
   於 QuickLook.PluginManager.LoadPlugins()
   於 QuickLook.PluginManager.GetInstance()
   於 QuickLook.App.RunListener(StartupEventArgs e)
   於 QuickLook.App.Application_Startup(Object sender, StartupEventArgs e)
   於 System.Windows.Application.OnStartup(StartupEventArgs e)
   於 System.Windows.Application.<.ctor>b__1_0(Object unused)
   於 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   於 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   於 System.Windows.Threading.DispatcherOperation.InvokeImpl()
   於 MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   於 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   於 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   於 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   於 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   於 System.Windows.Threading.DispatcherOperation.Invoke()
   於 System.Windows.Threading.Dispatcher.ProcessQueue()
   於 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   於 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   於 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   於 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   於 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   於 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   於 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   於 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   於 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   於 System.Windows.Application.RunDispatcher(Object ignore)
   於 System.Windows.Application.RunInternal(Window window)
   於 QuickLook.App.Main()
@david50407 david50407 changed the title Crashes on start Crashes on start (System.NotSupportedException, CAS policy) Jun 3, 2018
@xupefei
Copy link
Member

xupefei commented Jun 3, 2018

Try #1 and see.

@david50407
Copy link
Author

Oops, thanks.

Windows SmartScreen was jumped out on first exe launch (without unlocking zip), I thought that SmartScreen would unlock for me.

Everything is okay since I unlock it manually.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants