XAML Designer Window won't load for “Universal

2019-01-29 03:45发布

问题:

I seem to recall running into this before but can't for the life of me recall how I got around it and no depth of Googleing seems to help. Here's the problem:

When I open VS2015 (Community version) with a "Universal Windows" project, new or old, even without changing a single thing, I get an Exception in the designer window. The XAML code shows up fine, but the designer window gives me

"error 0X80070005: While processing the request, the system failed to register the windows.capability extension due to the following error: Access is denied."

This is followed by a wall of text I'll include below.

I wonder if this could be due to my having recently updated to Windows 10 (which I forced because for some reason it still wouldn't update without a common work-around) and my adding the features to my VS installation required to use Universal apps. If I open up a Universal Windows 8.1 project the designer loads just fine but not for a Universal Windows project.

Worth noting, I'm an amateur learning C#, so this could be simple but seems like a bug in the IDE to me...

Here's the wall of text in case it makes sense to anyone.

System.Exception Package could not be registered.

error 0x80070005: While processing the request, the system failed to register the windows.capability extension due to the following error: Access is denied. . at Microsoft.VisualStudio.DesignTools.HostUtility.Platform.AppContainerProcessDomainFactory.CreateDesignerProcess(String applicationPath, String clientPort, Uri hostUri, IDictionary environmentVariables, Int32& processId, Object& processData) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.ProcessDomainFactory.ProcessIsolationDomain..ctor(ProcessDomainFactory factory, IIsolationBoundary boundary, AppDomainSetup appDomainInfo, IIsolationTarget isolationTarget, String baseDirectory) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.ProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary) at Microsoft.VisualStudio.DesignTools.HostUtility.Platform.AppContainerProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.IsolationBoundary.Initialize() at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.IsolationBoundary.CreateInstance[T](Type type) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolatedObjectFactory.Initialize() at Microsoft.VisualStudio.DesignTools.DesignerHost.Services.VSIsolationService.CreateObjectFactory(IIsolationTarget isolationTarget, IObjectCatalog catalog) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget) at Microsoft.VisualStudio.DesignTools.DesignerContract.IsolatedDesignerService.CreateLease(IIsolationTarget isolationTarget, CancellationToken cancelToken, DesignerServiceEntry& entry, IServiceProvider serviceOverrides) at Microsoft.VisualStudio.DesignTools.DesignerContract.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolatedTaskScheduler.InvokeWithCulture[T](CultureInfo culture, Func2 func, CancellationToken cancelToken) at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolatedTaskScheduler.<>c__DisplayClass10_01.b__0() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute()

回答1:

Try to repair Visual Studio to make sure VS is in the right state. Go to the control panel, Programs, Uninstall a program, select Visual Studio and click Change. Once the installer starts, click Repair.

Martin



回答2:

It does have to do with upgrading to Windows 10. This is caused by your computer not being in Developer Mode. To fix this, on the start menu choose Settings, Update & Security, For Developers, Developer Mode, then accept the dialog. You are now in developer mode, and this should not be an issue.