使用WinRT应用程序时,Windows Server 2016上的XAML预览崩溃 [英] XAML preview crashes on Windows Server 2016 when working with WinRT applications

查看:70
本文介绍了使用WinRT应用程序时,Windows Server 2016上的XAML预览崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在项目所有者提供的VM上开发WinRT应用程序。 VM正在运行Windows Server 2016并安装了VS 2015(应用了更新3)。

I'm developing a WinRT application on a VM provided by the project owner. The VM is running Windows Server 2016 and has VS 2015 installed (Update 3 applied).

不幸的是,每当我想使用XAML预览窗口(即使是最简单的表单),我也会得到以下异常:

Unfortunately, whenever I want to use the XAML preview window (for even the simplest of forms) I get the following exception:

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()




p>


请注意我正在构建和运行的WinRT应用程序 - 问题仅出现在XAML设计器/预览窗口中。可能有什么问题?

Do note that the WinRT application I'm making builds and runs correctly - the problem is ONLY in the XAML designer / preview window. What could be wrong?

推荐答案

嗨Mateusz Bender,

Hi Mateusz Bender,

根据您的描述,我创建一个Windows Server 2016虚拟机并安装VS2015 Update 3.创建一个默认的WinRT应用程序并在其中添加一个空白页面,它可以正确加载。

According to your description, I create a Windows Server 2016 VM and install VS2015 Update 3. Create a default WinRT application and add a blank page in it, it could load correctly.

请尝试使用Visual Studio 2015创建一个新的默认WinRT应用程序,以检查它是否也有同样的问题。

Please try create a new default WinRT application with your Visual Studio 2015 to check whether it also has the same problem.

如果新项目有这个问题,那么应该是Visual Studio安装中的一些问题,请检查以下选项。

If the new project has this problem, there should be some problem in your Visual Studio installation, please check following options.


  • 确保您的Windows机器已设置为开发人员模式。如果没有,请转到开始菜单 - >设置 - >更新和安全 - >对于开发人员 - >开发者模式
  • 转到控制面板 - >程序和功能 - > Visual Studio 2015 - >更改以检查是否已安装所有与Windows相关的SDK安装
  • 修复Visual Studio以检查Visual Studio安装是否存在任何问题

如果新项目工作正常,我担心这个特定项目有任何问题。请联系项目所有者以确认其项目中是否使用了任何特定组件。

If the new project working fine, I'm afraid that there has any problem on this specific project. Please contact the project owner to confirm whether it used any specific components in his project.

最好的问候,

Weiwei

Best Regards,
Weiwei


这篇关于使用WinRT应用程序时,Windows Server 2016上的XAML预览崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆