简体   繁体   English

XAML Designer未加载

[英]XAML Designer is not loading

I am trying to develop a Universal application for Windows 10 but the XAML designer fails to load. 我正在尝试为Windows 10开发通用应用程序,但XAML设计器无法加载。 I have tried reinstalling Visual Studio but nothing has seemed to work. 我曾尝试重新安装Visual Studio,但似乎没有任何工作。

Error : 错误

System.Runtime.InteropServices.COMException System.Runtime.InteropServices.COMException
The app didn't start. 该应用程序没有启动。 (Exception from HRESULT: 0x8027025B) (HRESULT异常:0x8027025B)

Stacktrace : Stacktrace

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.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.b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

Had a similar problem. 有类似的问题。 Using VS 2015 Enterprise and Win8.1 x64. 使用VS 2015 Enterprise和Win8.1 x64。 Have solved it this way: 以这种方式解决了它:

  1. Start the Firewall service (was switched off) 启动防火墙服务(已关闭)

  2. Changed UAC to recommended level (was switched off) 将UAC更改为建议级别(已关闭)

  3. Logged in as Microsoft user account (as I suppose, this would be the crucial) 以Microsoft用户帐户登录(正如我想的那样,这将是至关重要的)

  4. Started the Windows Store App (have read this is the origin of all problems) 启动Windows应用商店应用程序(已阅读此内容是所有问题的根源)

  5. Started VS. 开始VS. After this designer began to work 这位设计师开始工作之后

  6. Reboot the system, restore all settings, incl. 重新启动系统,恢复所有设置,包括 Firewall & UAC At the end of all, designer is working properly under any user, even if MS user account is disabled. 防火墙和UAC最后,即使禁用了MS用户帐户,设计人员也可以在任何用户下正常工作。

I started noticing this problem some three weeks ago and I visited the Visual Studio Community 2017 forum. 大约三周前我开始注意到这个问题,我参观了Visual Studio Community 2017论坛。 I encountered the problem using the more recent versions, 15.7.5, 15.7.6, 15.8.0, 15.8.1. 我使用更新版本15.7.5,15.7.6,15.8.0,15.8.1遇到了问题。 I finally found that the problem was related to the choice of Target Version/Minimum Version you have to make while creating UWP project. 我终于发现问题与创建UWP项目时必须选择的目标版本/最低版本有关。 I always worked with a Blank UWP project and modifying it along the way. 我一直在使用Blank UWP项目并在此过程中对其进行修改。

If you are interested in complete details I have it in my post here: http://hodentekhelp.blogspot.com/2018/08/how-did-you-fix-unhandled-exception-app.html 如果您对完整的详细信息感兴趣,请在我的帖子中找到: http//hodentekhelp.blogspot.com/2018/08/how-did-you-fix-unhandled-exception-app.html

I just fixed this problem myself. 我自己解决了这个问题。 Apparently this error is connected with some windows system files which are most likely corrupted. 显然这个错误与一些很可能已损坏的Windows系统文件有关。 My app store didn't work either, but after I fixed visual studio, my store worked again as well. 我的应用程序商店也没有用,但在我修复了visual studio之后,我的商店也再次工作了。

In some cases the error might be less severe, and stem from a wrong configuration. 在某些情况下,错误可能不那么严重,并且源于错误的配置。

I looked around the web and found a series of recommendations, going from small fixes to more serious and throughout methods. 我环顾网络,发现了一系列建议,从小修正到更严肃的方法。 I'll list them here. 我会在这里列出来的。


1) Fix permissions in HKEY_CLASSES_ROOT 1)修复HKEY_CLASSES_ROOT中的权限

  1. Open the Command Prompt with admin rights. 使用管理员权限打开命令提示符。
  2. Right click on HKEY_CLASSES_ROOT. 右键单击HKEY_CLASSES_ROOT。
  3. Click on "Permissions" and in popup click on "Add". 单击“权限”,然后在弹出窗口中单击“添加”。
  4. In 2nd Popup click on "Advanced". 在第二个弹出窗口中单击“高级”。
  5. In 3rd Popus click on "Find Now". 在第3个Popus中点击“立即查找”。
  6. In "Search Results" click on "All Application Packages" and then click "Ok". 在“搜索结果”中单击“所有应用程序包”,然后单击“确定”。
  7. Now in 2nd Popup "Select Users or Groups" click again "Ok". 现在在第二个弹出窗口“选择用户或组”中再次单击“确定”。
  8. In Permissions select under Allow "Read" and Click "Ok". 在“权限”中,选择“允许”读取,然后单击“确定”。
  9. Close the Registry Editor. 关闭注册表编辑器。 No need to restart. 无需重启。

As adviced on the bottom of this page. 正如本页底部所述。 This did not work for me. 适合我。


2) Run this Powershell Command in Command Prompt 2)在命令提示符下运行此Powershell命令

Open the Command Prompt with Admin rights. 使用管理员权限打开命令提示符。

Copy paste the line below into the prompt and run it. 将下面的行复制粘贴到提示中并运行它。

 PowerShell -ExecutionPolicy Unrestricted -Command "& {$manifest = (Get-AppxPackage Microsoft.WindowsStore).InstallLocation + '\\AppxManifest.xml' ; Add-AppxPackage -DisableDevelopmentMode -Register $manifest}" 

Tip found here. 提示在这里找到。 This did not work for me. 适合我。


3) Clear the LocalCache 3)清除LocalCache

Go to the following place on your pc. 转到您电脑上的以下位置。 Remember to replace user_name with your own user name. 请记住使用您自己的用户名替换user_name

 C:\\Users\\user_name\\AppData\\Local\\Packages\\Microsoft.WindowsStore_8wekyb3d8bbwe\\LocalCache 

Delete the folders content. 删除文件夹内容。

Tip seen here. 提示在这里看到。 This did not work for me. 适合我。


4) Try running a SFC scan 4)尝试运行SFC扫描

Open the Command Prompt with admin rights. 使用管理员权限打开命令提示符。 Write the command below and let it complete. 写下面的命令,让它完成。

 sfc /scannow 

As seen here. 如此处所见。 This did not work for me. 适合我。 It did however verify that I had some corrupted files. 但它确实证实我有一些损坏的文件。 It wasn't able to fix/restore them though... 它虽然无法修复/恢复它们......


5) Run the DISM tool, then try SFC again 5)运行DISM工具,然后再次尝试SFC

Open Command Prompt with admin rights. 使用管理员权限打开命令提示符。 Run the command below. 运行以下命令。

 DISM /Online /Cleanup-Image /RestoreHealth 

If it completes successfully, run the sfc /scannow command again. 如果成功完成,请再次运行sfc /scannow命令。

As seen here. 如此处所见。 This did not work for me. 适合我。


6) Repair Windows 10 6)修复Windows 10

Warning! 警告! This process deletes all your programs and apps. 此过程会删除您的所有程序和应用程序。 It does however leave your files alone. 但它会让你的文件单独存在。 Eg my dropbox folder still had its files after running the repair. 例如,我的Dropbox文件夹在运行修复后仍然有其文件。

Please backup anything you do not want to lose to an external harddrive, the cloud or to a repository. 请将您不想丢失的任何内容备份到外部硬盘,云或存储库。

  1. Click the start button. 单击开始按钮。
  2. Click settings. 点击设置。
  3. Click update and security. 单击更新和安全性。
  4. Click recovery. 单击恢复。
  5. Click reset this PC and follow the instructions. 单击重置此PC并按照说明操作。

As seen here. 如此处所见。 This finally did the trick for me. 这终于为我做了伎俩。 My designer now loads and my win app store also works again. 我的设计师现在加载,我的win app store也可以再次运行。


There is most likely more tips and tricks to fix this kind of problem, but I hope the above gives you a lead on how to fix your problem. 很可能有更多的提示和技巧来解决这类问题,但我希望上面的内容能帮助您找到解决问题的方法。

Good luck, and please reply if any of the above worked for you :) 祝你好运,如果上述任何一项对你有用,请回复:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM