locked
Failed to load the XAML Designer suddenly. RRS feed

  • Question

  • Thanks in advanced.

    I am developing my own application using WPF C#, dot Net Core3.1.

    I did many jobs for it for about 2 month.

    And today VISUAL STUDIO 2019 cannot load the designer for XAML.

    I can build and run my application but I cannot look my XAML design preview.

    This is messages I got.

    An Unhandled Exception has occured

    ...

    System.IO.DirectoryNotFoundException

    Could not find a part of the path 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\SurfaceProcess\Wpf\Core\x64'. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileSystemEnumerableIterator`1.CommonInit() at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost) at System.IO.Directory.EnumerateFiles(String path) at Microsoft.VisualStudio.DesignTools.XamlDesignerHost.Platform.ShadowCopy.WpfCoreShadowCopyWorker.CopySurfaceProcessPayload(CancellationToken cancelToken) at Microsoft.VisualStudio.DesignTools.DesignerHost.HostServices.HostPlatformBase.EnsureSurfaceProcessPayload(IHostProject hostProject, SurfaceProcessInfo info, CancellationToken cancelToken) at Microsoft.VisualStudio.DesignTools.DesignerHost.HostServices.HostPlatformBase.<EnsureShadowCacheContent>d__27.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.DesignTools.DesignerHost.HostServices.HostPlatformBase.<CreateSurfaceProcessAsync>d__26.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.DesignTools.SurfaceDesigner.Documents.SurfaceIsolation.SurfaceProcessContext.<EnsureSurfaceProcessAsyncCore>d__104.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.DesignTools.SurfaceDesigner.Documents.SurfaceIsolation.SurfaceProcessContext.<EnsureSurfaceProcessAsyncInternal>d__102.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.DesignTools.XamlSurfaceDesigner.Views.IsolatedSurfaceImageHost.<CreateSurfaceAsync>d__66.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) System.AggregateException One or more errors occurred.


    I googled for several times. But this problem is occurred not so much.

    Please help me!

    Thank you!!

    Wednesday, September 2, 2020 11:16 AM

Answers

  • Hello,

    To verify it's not a problem with the current project, close Visual Studio, reopen Visual Studio, create a new WPF project and see if you can view the default window.

    If this works there is an issue with the project, if not contact Microsoft using the feedback/issue button top right corner of Visual Studio.

    You could also try closing Visual Studio, via Windows Explorer delete the bin and obj folder, open Visual Studio, rebuild the project by right clicking the project in solution explorer.

    Or start the Visual Studio installer and perform a repair.

    Lastly, have there been any updates to Visual Studio or Windows, this may have contributed to the issue.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by J Han Thursday, September 3, 2020 9:37 AM
    Wednesday, September 2, 2020 12:11 PM

All replies

  • Hello,

    To verify it's not a problem with the current project, close Visual Studio, reopen Visual Studio, create a new WPF project and see if you can view the default window.

    If this works there is an issue with the project, if not contact Microsoft using the feedback/issue button top right corner of Visual Studio.

    You could also try closing Visual Studio, via Windows Explorer delete the bin and obj folder, open Visual Studio, rebuild the project by right clicking the project in solution explorer.

    Or start the Visual Studio installer and perform a repair.

    Lastly, have there been any updates to Visual Studio or Windows, this may have contributed to the issue.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by J Han Thursday, September 3, 2020 9:37 AM
    Wednesday, September 2, 2020 12:11 PM
  • Hi J Han,
    Your question is mostly related to Visual Studio, so I suggest you ask the questions in Microsoft Q&A forum and you can get more professional answer.
    Thank you for your understanding.
    Best Regards,
    Daniel Zhang


    "Windows Forms General" forum will be migrating to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Windows Forms General" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.

    Thursday, September 3, 2020 2:09 AM
  • Hi, Karen!

    Thank you for your answer.

    I've done lots of things include your solutions but not work.

    I think some directories removed by accidentally in 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\SurfaceProcess\Wpf\Core\x64'

    I'm gonna report this issue to MS.

    Wish me luck :)

    Thank you again, Karen!

    Thursday, September 3, 2020 9:45 AM
  • Hi, Daniel!! 

    Thank you for your suggestion! :)

    Thursday, September 3, 2020 9:47 AM
  • Oh! 

    I didn't write the important facts.

    This problem doesn't occurred on VS 2019 16.7.1.

    After I updated to 16.7.2, this malfunction was occurred. 


    Thursday, September 3, 2020 9:58 AM