本文介绍了XAML设计器崩溃:System.UnauthorizedAccessException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用VS2015 Community Edition一段时间了,没有任何问题.现在,突然之间,XAML设计器将页面显示了几秒钟,然后崩溃了.这对我所有的项目都是如此.我最近升级了广告介体 控制,但我不知道是否存在某种关联.我收到的消息如下:

I've been using VS2015 Community edition for some time with no problems. Now, all of a sudden, the XAML designer displays the page for a few seconds and then crashes. This happens for all of my projects. I have recently upgraded the Advertising Mediator control, but I don't know if there is some correlation. The message I get is the following:

System.UnauthorizedAccessException

System.UnauthorizedAccessException

访问被拒绝. (来自HRESULT的异常:0x80070005(E_ACCESSDENIED))

Access denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

位于System.RuntimeTypeHandle.GetTypeByName(字符串名称,布尔型throwOnError,布尔型ignoreCase,布尔型反射Only,StackCrawlMarkHandle stackMark,IntPtr pPrivHostBinder,布尔型loadTypeFromPartialName,ObjectHandleOnStack类型) 在System.Runtime.DesignerServices.WindowsRuntimeDesignerContext.GetType(String)处System.RuntimeTypeHandle.GetTypeByName(字符串名称,布尔throwOnError,布尔ignoCase,仅布尔反射,StackCrawlMark& amp; Mark,IntPtr pPrivHostBinder,布尔loadTypeFromPartialName) Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.WindowsRuntimeContext.GetTypeFromWindowsRuntimeDesignerContext(String name)处的Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.GetRuntimeType(String typeFullName) Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.EmitContext.GetPlatformTypeInternal(Type type,Func`2 getPlatformType)上的Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.EmitContext.GetTypeFromRuntimeService(Type type) 在Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.EmitContext.GetPlatformTypeInternal(Type type)处Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.EmitContext.GetPlatformType(Type type)在Microsoft.VisualStudio.DesignTools.XamlDesigner.Meta .MockTypes.MockTypeGenerator.GetKnownType(Type Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.MockTypeGenerator.DefineType(Type类型)处Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.MockTypeGenerator.MockType(类型类型)处Microsoft.VisualStudio.DesignTools.XamlDesigner .Metadata.MockType.InitializeMockType() 在Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockType.get_RuntimeType()在Microsoft.VisualStudio.DesignTools.Platform.Metadata.ProjectContextType.InitializeClass()在Microsoft.VisualStudio.DesignTools.Platform.Metadata.MemberCollection.get_AttachedPropertyIndex() 在Microsoft.VisualStudio.DesignTools.Platform.Metadata.MemberCollection.CreateMember(MemberType memberTypes,String memberName, 会员密码Microsoft.VisualStudio.DesignTools.Platform.Metadata.MemberCollection.GetMember(MemberType的key)在Microsoft.VisualStudio.DesignTools.Platform.Metadata.MemberCollection.TryGetCachedMember(MemberType memberTypes,String memberName,Boolean create,IMember& Member)在Microsoft.VisualStudio.DesignTools.Platform.Metadata.MemberCollection.GetMember(MemberType Microsoft.VisualStudio.DesignTools.Platform.Metadata.ProjectContextType.GetMember的memberTypes,字符串memberName,MemberAccessTypes访问)(Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyMerger.GetPropertiesFromSelection(IEnumerable`1)上的memberTypes,String memberName,MemberAccessTypes访问) Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyMerger.GetMergedProperties(IEnumerable`1 selectedSceneNodes,Boolean includeStatics)的Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorInIntortorInternal Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.UpdateOnSelectionChanged(Boolean)上的Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.GetRenderedProperties(IReadOnlyList`1 selectedObjects) Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.UpdateSelectionCore(Boolean forceUpdate,Boolean shouldCloseOpenTransactions,Boolean)中的forceUpdate,布尔值ShouldCloseOpenTransactions,布尔值clearAddedProperties) Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.PropertyManager(zh-cn)上的clearAddedProperties)(Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.UpdateSelection(Boolean forceUpdate,Boolean shouldCloseOpenTransactions,Boolean) Microsoft.VisualStudio.DesignTools.Designer.Properties.PropertyManager.FireAllPropertyChangedEvents(SceneUpdatePhaseEventArgs args)处的发件人MultiplePropertyReferencesChangedEventArgs args). Microsoft.VisualStudio.DesignTools.Designer.ViewModel.SceneUpdatePhaseEventHandler.Invoke(Object sender,SceneUpdatePhaseEventArgs e)上的sender,SceneUpdatePhaseEventArgs args). args)在Microsoft.VisualStudio.DesignTools.Designer.View.SceneViewUpdateScheduleTask.UpdateLate()在Microsoft.VisualStudio.DesignTools.Utility.Scheduler.ScheduleTask.Update()在Microsoft.VisualStudio.DesignTools.Utility.Scheduler.SchedulingService.DispatchTasksAtPriority(DispatcherPrime System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate回调,Object args,Int32 numArgs)在Microsoft.VisualStudio.DesignTools.Utility.Scheduler.SchedulingService.DispatcherToken.Dispatch(Object arg)在System.Windows.Threading.ExceptionWrapper .TryCatchWhen(对象 源,委托回调,对象args,Int32 numArgs,委托catchHandler)在System.Windows.Threading.DispatcherOperation.InvokeImpl()在System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(对象状态)在System.Threading.ExecutionContext.RunInternal(ExecutionContext) 在System.Threading.ExecutionContext.Run(ExecutionContext执行上下文,ContextCallback回调,对象状态,布尔类型的saveSyncCtx)在System.Threading.ExecutionContext.Run(ExecutionContext)的executionContext,ContextCallback回调,对象状态,布尔类型的saveSyncCtx) 在System.Windows.Threading.DispatcherOperation.Invoke()在System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd,Int32 msg,IntPtr处的executionContext,ContextCallback回调,对象状态)在System.Windows.Threading.DispatcherOperation.Invoke()在System.Windows.Threading.Dispatcher.WndProcHook() wParam, IntPtr lParam,布尔值和在MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)在MS.Win32.HwndWrapper.WndProc(已处理)在MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Int32消息,IntPtr wParam,IntPtr lParam,布尔值和已处理)代表 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(对象源,委托回调,对象args,Int32 numArgs,委托catchHandler)在System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority)上进行回调,对象args,Int32 numArgs) MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam)的MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG)的优先级,TimeSpan超时,委托方法,对象args,Int32 numArgs) .Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame 在System.Windows.Application.RunInternal(Window窗口)在System.Windows.Application.Run.Dispatcher(对象忽略)在System.Windows.Application.RunInternal(窗口窗口)在System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame框架)窗口),位于Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.RunApplication() Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.DesignProcessViewProvider上的Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.DesignProcessViewProvider.AppContainerDesignerProcessRun(String [] activationContextArgs). 在System.Threading.ExecutionContext.RunInternal(ExecutionContext执行上下文,ContextCallback回调,对象状态,布尔型saveSyncCtx)在System.Threading.ExecutionContext.Run(ExecutionContext) System.Threading.ExecutionContext.Run处的executionContext,ContextCallback回调,对象状态,布尔类型的preserveSyncCtx)(System.Threading.ThreadHelper.ThreadStart()处的ExecutionContext,ContextCallback回调,对象状态)

at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.Runtime.DesignerServices.WindowsRuntimeDesignerContext.GetType(String typeName) at Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.WindowsRuntimeContext.GetTypeFromWindowsRuntimeDesignerContext(String name) at Microsoft.VisualStudio.DesignTools.Utility.WindowsRuntimeService.GetRuntimeType(String typeFullName) at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.EmitContext.GetTypeFromRuntimeService(Type type) at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.EmitContext.GetPlatformTypeInternal(Type type, Func`2 getPlatformType) at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.EmitContext.GetPlatformTypeInternal(Type type) at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.EmitContext.GetPlatformType(Type type) at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.MockTypeGenerator.GetKnownType(Type type) at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.MockTypeGenerator.DefineType(Type type) at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockTypes.MockTypeGenerator.MockType(Type type) at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockType.InitializeMockType() at Microsoft.VisualStudio.DesignTools.XamlDesigner.Metadata.MockType.get_RuntimeType() at Microsoft.VisualStudio.DesignTools.Platform.Metadata.ProjectContextType.InitializeClass() at Microsoft.VisualStudio.DesignTools.Platform.Metadata.MemberCollection.get_AttachedPropertyIndex() at Microsoft.VisualStudio.DesignTools.Platform.Metadata.MemberCollection.CreateAttachedProperty(String propertyName, MemberKey& key) at Microsoft.VisualStudio.DesignTools.Platform.Metadata.MemberCollection.CreateMember(MemberType memberTypes, String memberName, MemberKey& key) at Microsoft.VisualStudio.DesignTools.Platform.Metadata.MemberCollection.TryGetCachedMember(MemberType memberTypes, String memberName, Boolean create, IMember& member) at Microsoft.VisualStudio.DesignTools.Platform.Metadata.MemberCollection.GetMember(MemberType memberTypes, String memberName, MemberAccessTypes access) at Microsoft.VisualStudio.DesignTools.Platform.Metadata.ProjectContextType.GetMember(MemberType memberTypes, String memberName, MemberAccessTypes access) at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyMerger.GetPropertiesFromSelection(IEnumerable`1 selectedSceneNodes, Boolean includeStatics) at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyMerger.GetMergedProperties(IEnumerable`1 selectedSceneNodes, Boolean includeStatics) at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.GetPropertiesToShowInternal(IReadOnlyList`1 selectedObjects) at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.GetRenderedProperties(IReadOnlyList`1 selectedObjects) at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.UpdateOnSelectionChanged(Boolean forceUpdate, Boolean shouldCloseOpenTransactions, Boolean clearAddedProperties) at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.UpdateSelectionCore(Boolean forceUpdate, Boolean shouldCloseOpenTransactions, Boolean clearAddedProperties) at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.UpdateSelection(Boolean forceUpdate, Boolean shouldCloseOpenTransactions, Boolean clearAddedProperties) at Microsoft.VisualStudio.DesignTools.Designer.UI.PropertyInspector.PropertyInspectorModel.PropertyManager_MultiplePropertyReferencesChanged(Object sender, MultiplePropertyReferencesChangedEventArgs args) at Microsoft.VisualStudio.DesignTools.Designer.Properties.PropertyManager.FireAllPropertyChangedEvents(SceneUpdatePhaseEventArgs args) at Microsoft.VisualStudio.DesignTools.Designer.Properties.PropertyManager.SelectionManager_LateActiveSceneUpdatePhase(Object sender, SceneUpdatePhaseEventArgs args) at Microsoft.VisualStudio.DesignTools.Designer.ViewModel.SceneUpdatePhaseEventHandler.Invoke(Object sender, SceneUpdatePhaseEventArgs e) at Microsoft.VisualStudio.DesignTools.Designer.Selection.SelectionManager.FireLateActiveSceneUpdatePhase(SceneUpdatePhaseEventArgs args) at Microsoft.VisualStudio.DesignTools.Designer.View.SceneViewUpdateScheduleTask.UpdateLate() at Microsoft.VisualStudio.DesignTools.Utility.Scheduler.ScheduleTask.Update() at Microsoft.VisualStudio.DesignTools.Utility.Scheduler.SchedulingService.DispatchTasksAtPriority(DispatcherPriority priority) at Microsoft.VisualStudio.DesignTools.Utility.Scheduler.SchedulingService.DispatcherToken.Dispatch(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.RunApplication() at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.DesignProcessViewProvider.AppContainerDesignerProcessRun(String[] activationContextArgs) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.DesignProcessViewProvider.<>c__DisplayClass3_0.<applicationView_Activated>b__0() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

有什么想法吗?谢谢.

推荐答案

感谢您在MSDN论坛中发帖.

Thank you for posting in MSDN forum.

>>我最近升级了广告中介程序控件,但是我不知道是否存在某种关联.

>> I have recently upgraded the Advertising Mediator control, but I don't know if there is some correlation.

要确定它是否与升级有关,请打开Windows资源管理器,然后导航至< Visual Studio安装路径> \ Common7 \ IDE(默认为C:\ Program Files或Program Files(x86)\ Microsoft Visual Studio 14.0 \ Common7 \ IDE),以及 运行以下命令:

To make sure whether it is related to the upgrade, please open Windows Explorer, and navigate to  <Visual Studio Installation Path>\Common7\IDE (by default is C:\Program Files or Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE), and run the following commands:

Devenv.exe/SafeMode,这可以消除第三方加载项或程序包引起问题的可能性.从而确保稳定的执行.

Devenv.exe /SafeMode, This can eliminate the possibility that third party Add-ins or packages are causing problems. Thus ensuring stable execution.

如果在安全"模式下可以正常工作,我怀疑它与您计算机上的加载项有关,请转到工具->".加载项管理器可禁用所有加载项.

If in Safe mode, it works, I doubt that it is related to the add-ins on your machine, please go to Tools -> Add-in Manager to disable all the add-ins.

如果在安全模式下仍然崩溃,则可能是与访问被拒绝有关,我建议您可以使用流程监视器来找出您的Visual Studio无法访问的视频:

If in Safe mode, it still crash, maybe the issue is related to access denied, I suggest you could use process monitor to find out which one your visual studio couldn't access to:

1.从下载过程监视器http://technet.microsoft.com/zh-cn/sysinternals/bb896645.aspx
2.启动进程监视器->通过"Ctrl + E"->来停止进程监视器.通过"Ctrl + X"清除历史记录
3.在您准备好打开xaml文件之前,请先通过"Ctrl + E"启动Process Monitor.
4.复制问题时,例如发生崩溃.
5.通过"Ctrl + E"停止过程监视器.立即
6.将输出保存到.PML文件.或者,您可以直接从进程监视器"窗口中查看输出.

1.Download Process Monitor from http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
2.Start Process Monitor -> Stop Process Monitor by "Ctrl+E"-> Clear the history by "Ctrl+X"
3.Just before you are ready to open the xaml file, start the Process Monitor by "Ctrl+E".
4.When the issue is reproduced, for example, crashed.
5.Stop the Process Monitor by "Ctrl +E" immediately
6.Save the output to a .PML file. Or you can directly view the output from the Process Monitor window.

您可以通过搜索访问被拒绝"来验证这一点.输出中的关键字.找到它之后,获取它的所有权: https://technet.microsoft.com/en-us/library/cc753659.aspx

You can verify this by searching the "Access Denied" keywords from the output. After you find out it, take the ownership of it:https://technet.microsoft.com/en-us/library/cc753659.aspx

最好的问候,


这篇关于XAML设计器崩溃:System.UnauthorizedAccessException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 22:34
查看更多