VS2015 XAML Designer始终为System.UnauthorizedAccessException

时间:2015-11-23 08:32:54

标签: c# xaml

我有VS2015并遇到System.UnauthorizedAccessException的XAML Designer错误。我在Windows 10 build 10586上运行。

当我从项目中删除一些文件时,我没有遇到错误。构建项目后,运行的UWP应用程序以及调试器和XAML Designer开始抛出如下错误:

System.UnauthorizedAccessException
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
    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()

我无法看到元素Grid的属性,即使语法如下所示:

<Page
    x:Class="mstesting.BlankPage1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:mstesting"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    </Grid>
</Page>

我已经在Windows 10上启用了开发者模式。

1 个答案:

答案 0 :(得分:1)

更新到VS2015 Update 1肯定解决了这个问题。