Visual Studio 2015 WPF XAML Editor cannot open XAM

2019-06-15 07:27发布

I have recently updated from Visual Studio 2015 to Visual Studio 2015 Update 2 (Professional). Everything works fine except the fact that I can't open XAML files - after clicking on any XAML file I get:

Visual Studio has encountered an unexpected error.

It looks that XamlDesignerPackage hasn't been installed. XamlEditor entry doesn't exist under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\ and it exists under HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\ which may suggest that XAML Designer is not installed for this visual studio 2015.

I have tried everything:

  • 4 reinstalls
  • cleaning caches
  • removing ComponentDataCache
  • resetting settings.

In Visual Studio 2013 everything works fine. Is there a way to use XAMLEditor from VS2013? Do you have any ideas what I can do? I would be glad for any help since it prevents me from working. This is an error from ActivityLog.xml:

507 2016/04/04 13:15:58.450 Error VisualStudio SetSite failed for package [XamlDesignerPackage][Method failed with unexpected error code 50.]:{ at System.Security.AccessControl.NativeObjectSecurity.CreateInternal(ResourceType resourceType, Boolean isContainer, String name, SafeHandle handle, AccessControlSections includeSections, Boolean createByName, ExceptionFromErrorCode exceptionFromErrorCode, Object exceptionContext) at System.Security.AccessControl.FileSystemSecurity..ctor(Boolean isContainer, String name, AccessControlSections includeSections, Boolean isDirectory) at System.Security.AccessControl.FileSecurity..ctor(String fileName, AccessControlSections includeSections) at Microsoft.VisualStudio.DesignTools.Utility.IO.AccessHelper.IsAccessibleByAllApplicationPackages(String path) at Microsoft.VisualStudio.DesignTools.HostUtility.Utils.HostAppPackageAclService.CheckAclsOnDirectory(String directory) at Microsoft.VisualStudio.DesignTools.HostUtility.Utils.HostAppPackageAclService.ValidateOrUpdateDirectoryAcls(String directory) at Microsoft.VisualStudio.DesignTools.HostUtility.Utils.HostAppPackageAclService.ValidateOrUpdateAclsNoPrompt(IEnumerable`1 paths) at Microsoft.VisualStudio.DesignTools.DesignerContract.IsolatedDesignerService.Initialize() at MS.Internal.Package.XamlDesignerPackage.Initialize()
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)} {512BE089-83EC-4CC6-8483-CF16565AE209}


80131509 Method failed with unexpected error code 50.

Edit:

I have found that above guid exists in HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0_Config\ under Editors entry. It looks like designer hasn't been installed because it exists in vs 2013. There must be a conflict.

Edit: I have removed both 2013 and 2015 and installed 2015 and getting the following message when running Visual Studio 2015:

enter image description here

2条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-06-15 08:25

Fixed with Visual Studio Update 3

查看更多
叼着烟拽天下
3楼-- · 2019-06-15 08:30

From the ActivityLog.xml there is a clear indication that you have file access/permission issues. Those always manage to creep into providing us devs with un-needed issues. What I suggest you do is make sure you install VS as an administrator and also run it as Administrator.

I'm sure that will sort your issue out. Good luck.

查看更多
登录 后发表回答