13

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

MistyK
  • 6,055
  • 2
  • 42
  • 76
  • http://stackoverflow.com/questions/29994558/visual-studio-2015-c-sharp-xaml-designer-doesnt-load and http://stackoverflow.com/questions/30090719/view-designer-not-showing-up – StepUp Apr 05 '16 at 07:46
  • @StepUp It's not exactly the same problem - it's WPF project and their solutions is to change target version which is not present in wpf project. – MistyK Apr 05 '16 at 07:48
  • you cannot see XAML in XAML Designer? Could you post an image of your XAML Designer to clarify your question? – StepUp Apr 05 '16 at 07:50
  • @StepUp When I click on any XAML file in a solution I get "Unexpected error" and it doesn't open the xaml file. It's more like a XAMLEditor not only XAML Designer because it prevents me from editing XAML files. – MistyK Apr 05 '16 at 07:55
  • maybe you should just delete VS2013 and VS 2015? Then, at first install VS2015 and if you need install VS2013? – StepUp Apr 05 '16 at 08:05
  • I didn't want to uninstall it, just to have at least one working environment but it may help. Will give it a try – MistyK Apr 05 '16 at 08:08
  • @StepUp still doesn't work – MistyK Apr 05 '16 at 10:14
  • Have you uninstalled `VS 2013` and `VS2015` completely and then install just VS 2015? – StepUp Apr 05 '16 at 10:27
  • @StepUp yes and still getting exactly the same error. I've updated my original post to show what I get when I open vs – MistyK Apr 05 '16 at 10:30
  • please, read these links http://stackoverflow.com/questions/23893497/no-editoroptiondefinition-export-found-error and http://stackoverflow.com/questions/25573424/vs2013-error-loading-solution-javascriptwebextensionspackage-did-not-load-cor – StepUp Apr 05 '16 at 10:37
  • 1
    @StepUp nothing helps - I am moving back to vs 2013. Thanks for your help but it seems to be more complicated – MistyK Apr 05 '16 at 11:27
  • 1
    ask here. You have really nice question. I always was answered at the most complicated answer at MSDN WPF Forum. https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpf – StepUp Apr 05 '16 at 11:30
  • 1
    @StepUp thank you, will give it a try – MistyK Apr 05 '16 at 11:33
  • See my [answer here](http://stackoverflow.com/a/37100586/111794). – Zev Spitz May 08 '16 at 13:55
  • @ZevSpitz it doesn't work – MistyK May 10 '16 at 13:51
  • I can only suggest that you vote for the already submitted issue through the Send Feedback menu option in Visual Studio, as I noted in my comment [here](http://stackoverflow.com/q/36984909/111794). Hopefully, it will get more attention, the more votes it has. – Zev Spitz May 10 '16 at 18:12

2 Answers2

2

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.

Sizons
  • 640
  • 2
  • 8
  • 24
  • 1
    In my case, just applying the appropriate permission to the project folder (and it's children) solved the issue. – Gabriel Rainha Nov 11 '16 at 18:16
  • @GabrielRainha please help me to solve the same issue. What folder have you used to apply permission? VS %appdata% or %programfiles% ? And what permission should be set ? It is a pity that access denied error does not contain folder name. like any other file or folder exception. – oleksa Oct 06 '17 at 12:07
  • @oleksa I believe I meant the solution folder. Right-click the solution on Visual Studio, click Open Folder in File Explorer, right click the folder on Windows Explorer, click Properties, go to Security and set Read/Write permission to your user. It's been a long time since I replied to this issue, though, so I might as well be mistaken. – Gabriel Rainha Oct 06 '17 at 17:26
1

Fixed with Visual Studio Update 3

MistyK
  • 6,055
  • 2
  • 42
  • 76
  • still have this issue with `VS 2015 Version 14.0.25431.01 Update 3` and `VS2017 VisualStudio.15.Release/15.3.5+26730.16`. Me and two my colleagues – oleksa Oct 06 '17 at 12:02