1

I have been using Visual Studio Professional 2015 for a while now and recently updated to version 2. Since then I have been unable to open any of my .xaml documents.

I simply get Visual Studio has encountered an unexpected error. when double clicking them and occasionally another message prompting me to look at the activity log where i am getting snippet at the bottom.

I've re-installed probably about 6 times now removing any traces of program file folders, app data etc each time I do but nothing seems to fix it.

This only happens at the moment when I am at home though. I say this as i'm using a work laptop and my appdata folder is on our network. Of coarse I am VPN'ing in and have access to the network (actually have admin rights also) so don't know whether this gives you some indication over what could be going wrong. If this is the case what has changed in update 2 to now prevent me from using XAML designer away from the office?

I've spent a long time also trying to find a way of installing Visual Studio without any updates as i'm hoping this may fix the issue but each time I have tried this I wind up back with the updates.

Any help with this would be very much appreciated as given the amount of work I do with XAML files it's essentially rendered my visual studio program useless!!!

EDIT: Forgot to mention I've also tried a brand new WPF application proving it is not an issue with my projects and even if i go to Tools>Options>Text Editor>XAML>Miscellaneous I get an error coming up about the package so it is something at the core of Visual Studio and not specific to projects.

<entry> <record>481</record> <time>2016/05/02 13:18:16.714</time> <type>Information</type> <source>VisualStudio</source> <description>Begin package load [XamlDesignerPackage]</description> <guid>{512BE089-83EC-4CC6-8483-CF16565AE209}</guid> </entry> <entry> <record>482</record> <time>2016/05/02 13:18:16.736</time> <type>Error</type> <source>VisualStudio</source> <description>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)&#x000D;&#x000A; at System.Security.AccessControl.FileSystemSecurity..ctor(Boolean isContainer, String name, AccessControlSections includeSections, Boolean isDirectory)&#x000D;&#x000A; at System.Security.AccessControl.FileSecurity..ctor(String fileName, AccessControlSections includeSections)&#x000D;&#x000A; at Microsoft.VisualStudio.DesignTools.Utility.IO.AccessHelper.IsAccessibleByAllApplicationPackages(String path)&#x000D;&#x000A; at Microsoft.VisualStudio.DesignTools.HostUtility.Utils.HostAppPackageAclService.CheckAclsOnDirectory(String directory)&#x000D;&#x000A; at Microsoft.VisualStudio.DesignTools.HostUtility.Utils.HostAppPackageAclService.ValidateOrUpdateDirectoryAcls(String directory)&#x000D;&#x000A; at Microsoft.VisualStudio.DesignTools.HostUtility.Utils.HostAppPackageAclService.ValidateOrUpdateAclsNoPrompt(IEnumerable``1 paths)&#x000D;&#x000A; at Microsoft.VisualStudio.DesignTools.DesignerContract.IsolatedDesignerService.Initialize()&#x000D;&#x000A; at MS.Internal.Package.XamlDesignerPackage.Initialize()&#x000D;&#x000A; at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)}</description> <guid>{512BE089-83EC-4CC6-8483-CF16565AE209}</guid> <hr>80131509</hr> <errorinfo>Method failed with unexpected error code 50.</errorinfo> </entry> <entry> <record>483</record> <time>2016/05/02 13:18:16.737</time> <type>Error</type> <source>VisualStudio</source> <description>End package load [XamlDesignerPackage]</description> <guid>{512BE089-83EC-4CC6-8483-CF16565AE209}</guid> <hr>80131509</hr> <errorinfo>Method failed with unexpected error code 50.</errorinfo> </entry> <entry> <record>484</record> <time>2016/05/02 13:18:16.738</time> <type>Warning</type> <source>VisualStudio</source> <description>Package failed to load; error message suppressed by skip flag</description> <guid>{512BE089-83EC-4CC6-8483-CF16565AE209}</guid> </entry>

Graham
  • 41
  • 1
  • 9
  • Did you submit a bug report? (Help -> Send Feedback -> Report a problem) Actually, there already is a similar bug (search for `xaml unexpected error 50`); you can vote for it using the **Me too** link. – Zev Spitz May 08 '16 at 11:57
  • [This](http://stackoverflow.com/questions/36419828/visual-studio-2015-wpf-xaml-editor-cannot-open-xaml-files) question appears to be the same. – Zev Spitz May 08 '16 at 12:03

3 Answers3

1

Thanks for coming back to me. I had tried the above steps a few times but nothing seemed to work. I have now fixed it myself and thought i'd share my solution in case anyone else is unfortunate enough to come across this.

Basically the only thing that seemed to work for me is to download the ISO file and install from disk. The ISO comes with the updates but you have the option to deselect this in the custom install options.

It's now been a over a week and no issues so looks like it's fixed. It does, however, mean I am currently running without update 2 which given my experience I will continue to do so until I have to change but i'm half hoping even with update 2 ticked if installed from the ISO file it will still work.

Any way happy programming.

Graham
  • 41
  • 1
  • 9
1

I've had the same issue on Visual Studio 2017.

One step I would suggest to see if the problem is similar to the one I was having, is to try and open another solution and see if XAML loads properly. In my case I noticed that it was only that particular solution I was working on that caused this issue. So I ended up starting and new solution and added the projects one by one. After that, everything went back to normal.

I was never able to get down to the bottom of the root cause of the issue. however, since all I did was to replace the solution file, I suspect that it had something to do with a certain build configuration not being set properly.

hope this helps.

Jay M
  • 979
  • 1
  • 12
  • 23
0

The following steps worked for me:

  1. Installed the updates for Visual Studio 2015 Update 2.
  2. Ran a Repair from the Control Panel (Programs and Features).
  3. Restarted the computer

NB. Installing the update alone wasn't enough, but a repair+restart might have been sufficient.

Zev Spitz
  • 13,950
  • 6
  • 64
  • 136