"此应用不支持指定的合同或未安装" Visual Studio设计器中的错误

时间:2017-08-16 13:29:05

标签: visual-studio-2015 windows-server-2016 windows-rt

我在运行Windows Server 2016的项目所有者提供的VM上开发我的应用程序时遇到问题。

我面临的问题是在Visual Studio 2015中开发WinRT应用程序时以及使用XAML文件时 - Visual Studio无法打开XAML的可视编辑器/预览并抛出以下错误:

System.Runtime.InteropServices.COMException
This app does not support the contract specified or is not installed. (Exception from HRESULT: 0x80270254)
   at Microsoft.VisualStudio.DesignTools.HostUtility.AppPackage.AppPackageNativeMethods.IApplicationActivationManager.ActivateApplication(String appUserModelId, String activationContext, ActivateOptions options, Int32& processId)
   at Microsoft.VisualStudio.DesignTools.HostUtility.AppPackage.DesignerWrtUtility.ActivateApplication(String appUserModelId, String activationContext, Object site, Boolean isRunningElevated)
   at Microsoft.VisualStudio.DesignTools.HostUtility.Platform.AppContainerProcessDomainFactory.ActivateApplicationInternal(String appUserModelId, String activationContext, Object site)
   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, Func`2 func, CancellationToken cancelToken)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolatedTaskScheduler.<>c__DisplayClass10_0`1.<StartTask>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

我可以很好地启动应用程序,所以问题只出在VS编辑器上。

知道如何解决这个问题吗?

2 个答案:

答案 0 :(得分:0)

我遇到了同样的错误,并认为它可能与运行比Windows支持的版本更高的SDK有关。可悲的是,我对此主题一无所知,来到这里也试图获得解决方案,但是问题只有在我尝试更新所有正在使用的软件后才变得明显。

答案 1 :(得分:0)

我在Windows 10上遇到了几乎相同的问题。我无法打开系统设置,网络设置和其他应用程序。当我尝试使用RUN命令ms-settings:打开设置时,我得到了相同的错误消息。尝试了几乎所有可能的方式在Internet上编写。

因此,只有以下内容起作用。 我通过以下命令使用powershell重新安装和重新注册了Windows Apps。

为此,请打开PowerShell(只需在“开始”菜单的“搜索”中键入“ powershell”,然后右键单击它并“以管理员身份运行”)并输入以下命令:

Get-AppXPackage | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

重新启动系统。

解决方案位于此网站上:https://www.maketecheasier.com/fix-settings-app-not-working-in-windows-10/