WPF designer - Access is denied 0x80070005

  • Thread starter Thread starter Ernst Jan Reinders
  • Start date Start date
E

Ernst Jan Reinders

Guest
Hi,

Have a problem with a new installation of Visual Studio 2017 - Version 15.9.9 on new notebook.

Installation did not have any problem. Loaded project I am working on without a problem.

But WPF designer is showing the next error

System.UnauthorizedAccessException
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at Microsoft.VisualStudio.DesignTools.Utility.AssemblyHelper.LoadFile(String path, Action`1 logger)
at Microsoft.VisualStudio.DesignTools.Designer.Metadata.Assemblies.AssemblyService.CreateClassicShadowCopy(String assemblyPath, String projectPath, ReferenceAssemblyContext context, Boolean useReflectionOnlyLoad)
at Microsoft.VisualStudio.DesignTools.Designer.Metadata.Assemblies.AssemblyService.ResolveShadowCopyAssembly(String assemblyPath, String projectPath, ReferenceAssemblyContext context, Boolean useReflectionOnlyLoad)
at Microsoft.VisualStudio.DesignTools.Designer.Metadata.Assemblies.AssemblyService.ResolveAssembly(String assemblyPath, String assemblyFullName, String projectPath, ReferenceAssemblyContext context, Boolean useReflectionOnlyLoad)
at Microsoft.VisualStudio.DesignTools.Designer.Metadata.Assemblies.ProjectAssemblyResolver.GetAssemblyInformationInternal(String path)
at Microsoft.VisualStudio.DesignTools.Designer.Metadata.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(String assemblyLocation)
at Microsoft.VisualStudio.DesignTools.Designer.Metadata.Assemblies.ProjectAssemblyResolver.InternalAddAssemblyReference(String assemblyLocation)
at Microsoft.VisualStudio.DesignTools.Designer.Metadata.Assemblies.ProjectAssemblyResolver.UpdateAssemblyReferences(IEnumerable`1 referencesToUpdate)
at Microsoft.VisualStudio.DesignTools.Designer.Metadata.Assemblies.ProjectAssemblyResolver.Initialize()
at Microsoft.VisualStudio.DesignTools.Designer.Metadata.Assemblies.ProjectAssemblyService.GetProjectAssemblyResolver(IHostProject project)
at Microsoft.VisualStudio.DesignTools.Designer.Metadata.Assemblies.ProjectAssemblyService.CreatePlatformReferenceAssemblyResolver(IHostProject project)
at Microsoft.VisualStudio.DesignTools.Designer.Documents.Project.ProjectContextManager.CreatePlatformReferenceAssemblyResolver(IHostProject project)
at Microsoft.VisualStudio.DesignTools.Designer.Documents.Project.ProjectContextManager.GetProjectContext(IHostProject project, IPlatform platform, Boolean create)
at Microsoft.VisualStudio.DesignTools.Designer.Documents.Project.ProjectContextManager.<GetContextsInActiveSolution>d__94.MoveNext()
at Microsoft.VisualStudio.DesignTools.XamlDesigner.Commands.ReplaceStyleTemplateCommand.ResolveDefaultStyle(SceneNode targetElement, Object defaultStyleKey, Boolean allowDefaultStyle, DocumentNode& currentStyle, Boolean& isThemeStyle, IList`1& auxiliaryResources)
at Microsoft.VisualStudio.DesignTools.XamlDesigner.Commands.ReplaceStyleTemplateCommand.ProvideCurrentStyle(SceneNode targetElement, IType targetType, PropertyReference targetPropertyReference, Boolean allowDefaultStyle, IList`1& auxiliaryResources)
at Microsoft.VisualStudio.DesignTools.XamlDesigner.Commands.EditCopyOfStyleCommand.get_IsEnabled()
at Microsoft.VisualStudio.DesignTools.Utility.Commands.Command.GetProperty(String propertyName, Object defaultValue)
at Microsoft.VisualStudio.DesignTools.XamlDesigner.Commands.ReplaceStyleTemplateCommand.GetProperty(String propertyName)
at Microsoft.VisualStudio.DesignTools.Utility.Commands.CommandTarget.<>c__DisplayClass21_0.<GetCommandProperty>b__0()
at Microsoft.VisualStudio.DesignTools.Utility.ProtectionZone.DummyProtectionZone.Execute[T](Func`1 func)
at Microsoft.VisualStudio.DesignTools.Utility.Commands.CommandTarget.GetCommandProperty(String commandName, String propertyName)
at Microsoft.VisualStudio.DesignTools.Designer.Views.SceneView.UpdateCommandState(IEnumerable`1 commandNames, Boolean forceRefresh)
at Microsoft.VisualStudio.DesignTools.Designer.Views.SceneView.SelectionManager_LateActiveSceneUpdatePhase(Object sender, SceneUpdatePhaseEventArgs args)
at Microsoft.VisualStudio.DesignTools.Designer.ViewModel.SceneUpdatePhaseEventHandler.Invoke(Object sender, SceneUpdatePhaseEventArgs e)
at Microsoft.VisualStudio.DesignTools.Designer.ViewModel.Selection.SelectionManager.FireLateActiveSceneUpdatePhase(SceneUpdatePhaseEventArgs args)
at Microsoft.VisualStudio.DesignTools.Designer.Views.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 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext 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.<>c__DisplayClass3_0.<Main>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()

The first load is fine and shows the form but as soon I want to change and of the XAML code the above error shows in designer. When clicking the option 'Click her to reload the designer' the view is showing again.

Have search for solutions but none is working or give me a clue where there problem comes from.

One solution was to remove privateregistry.bin which I did but that did not work.

Problem occurs with every view/form/usercontrol even newly created one.

Building the project is no problem and everything works.


Can someone please help me get rid of this problem?


Greetings,

Ernst Jan

Continue reading...
 
Back
Top