locked
An unhandled exception has occured (XAML Designer)

    Question

  • Hi all,

    I am trying to create my HelloWorld app for Windows 8 building with C# in Visual Studios 2012 (http://msdn.microsoft.com/en-us/library/windows/apps/jj676793#download_locations). However I am unable to load the designer after double-clicking the MainPage.xaml (which is a Basic Page).  Please help me :(

    It says "An unhandled exception has occured" and here are the details:

    System.Runtime.InteropServices.COMException
    Error HRESULT E_FAIL has been returned from a call to a COM component.
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CallSynchronizationMode syncMode, WaitHandle timeoutSignal)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CallSynchronizationMode syncMode)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func, CallSynchronizationMode syncMode)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass12.<Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner>b__11(RemoteCancellationToken remoteToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CallWithCancellation[TResult](CancellationToken cancelToken, Func`2 func)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)

    System.Runtime.InteropServices.COMException
    Error HRESULT E_FAIL has been returned from a call to a COM component.

    Server stack trace:
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken remoteToken)
       at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
       at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass8.<CreateDesignerImpl>b__6(IRemoteDesignerService d)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass4`2.<MarshalOut>b__3()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

    System.Runtime.InteropServices.COMException
    Error HRESULT E_FAIL has been returned from a call to a COM component.
       at Windows.Foundation.IAsyncOperation`1.GetResults()
       at Microsoft.Expression.WindowsXamlPlatform.Host.RuntimeResourceManager.GetStorageFileForPath(String indexPath)
       at Microsoft.Expression.WindowsXamlPlatform.Host.RuntimeResourceManager.ProcessIndexUpdates()
       at Microsoft.Expression.WindowsXamlPlatform.Host.RuntimeResourceManager.OnNewIndex(String newFileName, String newResourceMapName)
       at Microsoft.Expression.WindowsXamlPlatform.Host.XamlUIPresenterHostServices.OnResourceIndexUpdated(HostResourceIndexUpdatedEventArgs args)
       at Microsoft.Expression.WindowsXamlPlatform.Host.WindowsUIXamlResourceIndexProvider.OnResourceIndexUpdated(EventArgs args)
       at Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<>c__DisplayClass12.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__f(CancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.CallWithCancellation[TResult](IRemoteCancellationToken remoteToken, Func`2 func)
       at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__e()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15()
       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()



    Friday, October 26, 2012 6:14 PM

Answers

  • Thanks for your reply. I'm sorry, I was not able to reply earlier.... Anyway, I was having overall problems with my Windows 8 installation on dual boot on my MacBook Pro and it is probably the reason why Visuual Studios 2012 is buggy...  The application was running but I just was unable to load the designer for some reason. And for your information, I have created successfully my first Windows 8 app HelloWorld on my XPS Dell M1710. So thanks for your answers and I consider this case solved!

    Cheers,

    -Lester

    Wednesday, November 07, 2012 4:28 PM

All replies

  • You are right! Try to put this line inside the app.xaml file

            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <!-- 
                        Styles that define common aspects of the platform look and feel
                        Required by Visual Studio project and item templates
                     -->
                    <ResourceDictionary Source="Common/StandardStyles.xaml"/>
                </ResourceDictionary.MergedDictionaries>
                <Style x:Key="BigGreenTextStyle" TargetType="TextBlock">
                    <Setter Property="Foreground" Value="Green"/>
                    <Setter Property="FontSize" Value="36"/>
                    <Setter Property="FontFamily" Value="{StaticResource ContentControlThemeFontFamily}"/>
                    <Setter Property="TextTrimming" Value="WordEllipsis"/>
                    <Setter Property="TextWrapping" Value="Wrap"/>
                    <Setter Property="Typography.StylisticSet20" Value="True"/>
                    <Setter Property="Typography.DiscretionaryLigatures" Value="True"/>
                    <Setter Property="Typography.CaseSensitiveForms" Value="True"/>
                </Style>
                <x:String x:Key="AppName">HelloWorld</x:String>
            </ResourceDictionary>


    • Proposed as answer by turibbioMVP Friday, October 26, 2012 8:34 PM
    • Edited by turibbioMVP Friday, October 26, 2012 8:36 PM grammar review
    Friday, October 26, 2012 8:34 PM
  • Tried it and it did not changed a thing :( Still doesn't load the designer on MainPage.xaml with the same error details. Any other ideas?
    • Proposed as answer by shankar gounder Wednesday, December 31, 2014 8:30 PM
    Saturday, October 27, 2012 2:34 PM
  • When you run the app, if there's any problem, a popup shows up. Type here the error, non the stack trace.
    • Proposed as answer by shankar gounder Wednesday, December 31, 2014 8:30 PM
    Saturday, October 27, 2012 5:08 PM
  • Did you solve the issue? Did the application compile and run? When run, do you get any error?
    Sunday, October 28, 2012 9:42 AM
  • Thanks for your reply. I'm sorry, I was not able to reply earlier.... Anyway, I was having overall problems with my Windows 8 installation on dual boot on my MacBook Pro and it is probably the reason why Visuual Studios 2012 is buggy...  The application was running but I just was unable to load the designer for some reason. And for your information, I have created successfully my first Windows 8 app HelloWorld on my XPS Dell M1710. So thanks for your answers and I consider this case solved!

    Cheers,

    -Lester

    Wednesday, November 07, 2012 4:28 PM
  • I'm having the same issue. The computer was originality running Windows 7 Pro, and I did an upgrade to Windows 8 Pro. I had Visual Studios 2013 installed before the upgrade. Everything seems to work fine, but when I tried to start messing around with the same tutorial linked above and I get the error I have bellow. I've tried doing a repair on VS 2012, I also have Office 2013, and VS 2010 installed on this computer. I've also tried the following the guide on this LINK with no improvement. The only thing I could think about trying next is to reformat my computer, but something I'm strongly trying to avoid. Also the program dose compile and I can debug it. I've also taken a peek at the even log and when I "Click here to reload the designer" I get this error "Activation of the app App.aecb69a7d.aa7d8.a46a8.aafca.a31507e9ca5b7_8wekyb3d8bbwe!Designer.App for the Windows.Launch contract failed with error: The app didn't start.."

    System.Runtime.InteropServices.COMException
    The app didn't start. (Exception from HRESULT: 0x8027025B)
       at Microsoft.Expression.HostUtility.AppPackage.AppPackageNativeMethods.IApplicationActivationManager.ActivateApplication(String appUserModelId, String activationContext, ActivateOptions options, Int32& processId)
       at Microsoft.Expression.HostUtility.AppPackage.WrtUtility.ActivateApplication(String appUserModelId, String activationContext, Object site)
       at Microsoft.Expression.HostUtility.Platform.AppContainerProcessDomainFactory.ActivateApplicationInternal(String appUserModelId, String activationContext, Object site)
       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, Func`2 func, CancellationToken cancelToken)
       at Microsoft.Expression.DesignHost.Isolation.IsolatedTaskScheduler.<>c__DisplayClassa`1.<StartTask>b__6()
       at System.Threading.Tasks.Task`1.InnerInvoke()
       at System.Threading.Tasks.Task.Execute()



    Wednesday, November 07, 2012 9:30 PM
  • Hi, I have exactly same problem. Same error message when I try to open .xaml file in designer in VS 2013 Express (and VS 2012 Pro). The post marked as an answer is a joke. Of course VS 2013 works in some environments, so change of whole PC or re-installation of whole windows changes everything and has nothing to do with problem solving.

    I started my own thread for this issue:

    https://social.msdn.microsoft.com/Forums/windowsapps/en-US/f862d66f-60a2-4ca5-b17d-53a4a3ac8d6d/visual-studio-express-2013-designer-doesnt-load?forum=toolsforwinapps

    I am looking forward for a solution. Please help.



    System.Runtime.InteropServices.COMException The app didn't start. (Exception from HRESULT: 0x8027025B) at Microsoft.Expression.HostUtility.AppPackage.AppPackageNativeMethods.IApplicationActivationManager.ActivateApplication(String appUserModelId, String activationContext, ActivateOptions options, Int32& processId) at Microsoft.Expression.HostUtility.AppPackage.WrtUtility.ActivateApplication(String appUserModelId, String activationContext, Object site) at Microsoft.Expression.HostUtility.Platform.AppContainerProcessDomainFactory.ActivateApplicationInternal(String appUserModelId, String activationContext, Object site) 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.IsolatedObjectFactory.Initialize() at Microsoft.VisualStudio.ExpressionHost.Services.VSIsolationService.CreateObjectFactory(IIsolationTarget isolationTarget, IObjectCatalog catalog) at Microsoft.Expression.DesignHost.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget) at Microsoft.Expression.DesignHost.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget) 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, Func`2 func, CancellationToken cancelToken) at Microsoft.Expression.DesignHost.Isolation.IsolatedTaskScheduler.<>c__DisplayClassa`1.<starttask>b__6() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() </starttask>

    • Edited by storm_blast Wednesday, December 17, 2014 9:53 AM
    • Proposed as answer by shankar gounder Wednesday, December 31, 2014 8:31 PM
    Wednesday, December 17, 2014 9:17 AM
  • hello sir

    i have also same problem(an unhandled exception occurs) will you help me to get designer page

    Wednesday, December 31, 2014 8:29 PM
  • Please try to open windows store, if it doesn't load it should be missing permissions, and try this;

    Open Registry Editor using regedit.exe.

    1. Right click on HKEY_CLASSES_ROOT.
    2. Click on "Permissions" and in popup click on "Add".
    3. In 2nd Popup click on "Advanced".
    4. In 3rd Popus click on "Find Now".
    5. In "Search Results" click on "All Application Packages" and then click "Ok".
    6. Now in 2nd Popup "Select Users or Groups" click again "Ok".
    7. In Permissions select under Allow "Read" and Click "Ok".
    8. Close the Registry Editor. No need to restart.

    Found this solution after giving up programming with vs community, I was just trying to open the store. Now VS works fine.

    Thursday, March 26, 2015 11:33 AM
  • Thanks! It work for me!
    Tuesday, March 31, 2015 6:55 AM