wpf 编辑XAML出现Exception from HRESULT: 0x80131515

本文提供了解决方法:将工程打包为ZIP文件,修改安全属性以获得完全控制权限,确保所有用户包括everyone都能进行操作,然后解压并重新打开工程,以解决由于权限不足导致的无法正常打开工程的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

出现这个错误主要是因为目前的用户编辑权限不够,

解决方法,把工程打成ZIP包,然后右键--属性 在安全里面把所有的用户都设置成完全控制,记得把everyone也设置好,然后解压,再打开工程看看,是不是已经好了。

System.InvalidOperationException HResult=0x80131509 Message=Call from invalid thread Source=Avalonia.Base StackTrace: 在 Avalonia.Threading.Dispatcher.<VerifyAccess>g__ThrowVerifyAccess|16_0() 在 Avalonia.AvaloniaObject..ctor() 在 Avalonia.Media.Brush..ctor() 在 Avalonia.Media.SolidColorBrush..ctor() 在 LoadingUnloadVehicle.App.XamlClosure_1.Build_33(IServiceProvider ) 在 F:\ProjectDir\VSProject\LoadingUnloadVehicle\LoadingUnloadVehicle\App.axaml: 第 66 行 在 Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers.DeferredContent`1.Build(IServiceProvider serviceProvider) 在 Avalonia.Controls.ResourceDictionary.TryGetValue(Object key, Object& value) 在 Avalonia.Controls.ResourceDictionary.TryGetResource(Object key, ThemeVariant theme, Object& value) 在 LoadingUnloadVehicle.PublicMethod.SetColor(String resourceName) 在 F:\ProjectDir\VSProject\LoadingUnloadVehicle\LoadingUnloadVehicle\PublicMethod.cs 中: 第 85 行 在 LoadingUnloadVehicle.ViewModels.HuoYunZuoYeModel.GetInit(String guName, List`1 list) 在 F:\ProjectDir\VSProject\LoadingUnloadVehicle\LoadingUnloadVehicle\ViewModels\HuoYunZuoYeModel.cs 中: 第 53 行 在 LoadingUnloadVehicle.Tcp.ProcessMsg.MessageSplitFlow(FromServerMsg message) 在 F:\ProjectDir\VSProject\LoadingUnloadVehicle\LoadingUnloadVehicle\Tcp\ProcessMsg.cs 中: 第 136 行 此异常最初是在此调用堆栈中引发的: Avalonia.Threading.Dispatcher.VerifyAccess.__ThrowVerifyAccess|16_0() Avalonia.AvaloniaObject.AvaloniaObject() Avalonia.Media.Brush.Brush() Avalonia.Media.SolidColorBrush.SolidColorBrush() LoadingUnloadVehicle.App.XamlClosure_1.Build_33(System.IServiceProvider) (位于 App.axaml 中) Avalonia.Markup.Xaml.XamlIl.Runtime.XamlIlRuntimeHelpers.DeferredContent<T>.Build(System.IServiceProvider) Avalonia.Controls.ResourceDictionary.TryGetValue(object, out object) Avalonia.Controls.ResourceDictionary.TryGetResource(object, Avalonia.Styling.ThemeVariant, out object) LoadingUnloadVehicle.PublicMethod.SetColor(string) (位于 PublicMethod.cs 中) LoadingUnloadVehicle.ViewModels.HuoYunZuoYeModel.GetInit(string, System.Collections.Generic.List<LoadingUnloadVehicle.Entity.HuoYunYuanWork>) (位于 HuoYunZuoYeModel.cs 中) ... [调用堆栈已截断]
最新发布
07-23
System.IO.DirectoryNotFoundException HResult=0x80070003 Message=Could not find a part of the path 'F:\Resources\bg_iSpt.png'. Source=System.Private.CoreLib StackTrace: 在 Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options) 在 Microsoft.Win32.SafeHandles\SafeFileHandle.cs 中: 第 288 行 在 Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) 在 Microsoft.Win32.SafeHandles\SafeFileHandle.cs 中: 第 248 行 在 System.IO.File.ReadAllBytes(String path) 在 System.IO\File.cs 中: 第 348 行 在 ImoutoRebirth.Navigator.ApngWpfPlayer.ApngEngine.ApngImage..ctor(String fileName) 在 ImoutoRebirth.Navigator.ApngWpfPlayer.ApngPlayer.ApngPlayer.<ReloadApng>d__9.MoveNext() 在 ImoutoRebirth.Navigator.ApngWpfPlayer.ApngPlayer.ApngPlayer.<OnSourceChanged>d__8.MoveNext() 在 System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state) 在 System.Threading.Tasks\Task.cs 中: 第 1925 行 在 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) 在 System.Threading\ExecutionContext.cs 中: 第 138 行 --- 上一位置中堆栈跟踪的末尾 --- 在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Threading\ExecutionContext.cs 中: 第 153 行 在 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) 在 APNGDemo.App.Main()
07-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值