3
votes

The designer for XAML code is not getting loaded in Visual Studio 2012. The following error is getting displayed. Any help is appreciated.

System.ObjectDisposedException Safe handle has been closed at Microsoft.Expression.HostUtility.Platform.AppContainerProcessDomainFactory.CreateDesignerProcess(String applicationPath, String clientPort, Uri hostUri, IDictionary environmentVariables, Int32& processId, Object& processData) at Microsoft.Expression.DesignHost.Isolation.Primitives.ProcessDomainFactory.ProcessIsolationDomain..ctor(ProcessDomainFactory factory, IIsolationBoundary boundary, AppDomainSetup appDomainInfo, FrameworkName targetFramework, String identifier, String baseDirectory) at Microsoft.Expression.DesignHost.Isolation.Primitives.ProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary) at Microsoft.Expression.HostUtility.Platform.AppContainerProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary) at Microsoft.Expression.DesignHost.Isolation.Primitives.IsolationBoundary.Initialize() at Microsoft.Expression.DesignHost.Isolation.Primitives.IsolationBoundary.CreateInstance[T](Type type) at Microsoft.Expression.DesignHost.Isolation.IsolatedExportProvider.Initialize() at Microsoft.VisualStudio.ExpressionHost.Services.VSIsolationService.CreateExportProvider(IIsolationTarget isolationTarget, ICatalogFactory catalogFactory, IExportFilter filter) at Microsoft.Expression.DesignHost.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget) at Microsoft.Expression.DesignHost.IsolatedDesignerService.CreateLease(IIsolationTarget isolationTarget, CancellationToken cancelToken, DesignerServiceEntry& entry) at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken) at Microsoft.Expression.DesignHost.Isolation.IsolatedTaskScheduler.InvokeWithCulture[T](CultureInfo culture, Func2 func, CancellationToken cancelToken) at Microsoft.Expression.DesignHost.Isolation.IsolatedTaskScheduler.<>c__DisplayClassa1.b__6() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute()

3
Maybe your XAML code isn't valid? - Smartis
XAML code is valid only. I already checked for different projects for which it worked fine earlier. - Ramesh
And the Namespace Assemblies? Maybe one of these causes an exception. stackoverflow.com/questions/1625081/… - Smartis

3 Answers

1
votes

I was getting the same problem. Try restarting Visual Studio. If it still does not work, uninstall VS, then reinstall. I think It will do the trick.

1
votes

Source : https://social.msdn.microsoft.com/Forums/en-US/8e58ee68-341a-4792-9bb2-a155cfc06f90/cannot-use-visual-studio-community-2015-xaml-designer-unhandled-exception

Navigate to \Common7\IDE (by default is C:\Program Files or Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE), and run the following commands:

a) devenv.exe /resetsettings, it will restore Visual Studio default settings. Optionally resets the settings to the specified .vssettings file.

b) devenv.exe /resetuserdata, it will take a couple of minutes to run as Visual Studio cleans up and sets itself back to its original state. You may open Task Manager at this point to check whether the devenv.exe process is still running. After it has completed running, you can restart Visual Studio.

0
votes

This is an old question, but I faced the same problem in Visual Studio 2013 Express for Windows Update 2 which happens to be the latest update.

I tried the following: Installing correct file version of VS 2013 (As it happens there were two) I had assumed that Windows Update would install the recommended KB article, KB 2883200 for my x64 bit machine. It was not installed so I installed it.

These changes only marginally improved but the loading of XAML pages and deploying the Windows 8.1 did not improve.

What finally improved was removing two other VS programs on my computer, the VS 2013 Express for WEB and the VS 2013 Express for Windows Desktop.

Now the XMAL pages are loading as they should and I am not getting the "System.ObjectDisposedException Safe handle has been closed" Details are here:

http://hodentek.blogspot.com/2014/05/programs-that-interfered-while-loading.html