vs2022 17.12.4 can not open .net winform designer

0 Reputation points
2025-01-22T00:33:46.9833333+00:00

can not open .net winform designer

error:

[08:46:51.219341] info: Visual Studio culture: ja-JP (0x0411)

[08:46:51.219341] info: [Thread 12] Launching server...

[08:46:51.219341] info: Is processor architecture ARM64: False

[08:46:51.328564] info: WinFormsAutoToolboxManagerService::IsProjectSupportedByOutOfProcDesigner invoked.

[08:46:51.328564] info: WinFormsAutoToolboxManagerService::IsSupportedCoreProject = true.

[08:46:51.328564] info: WinFormsAutoToolboxManagerService::RefreshToolboxIfNecessary invoked

[08:46:51.328564] info: WinFormsAutoToolboxManagerService::IsToolboxVisible = False.

[08:46:51.328564] info: WinFormsAutoToolboxManagerService::IsToolboxVisible = False, _toolboxItemsInitialized = False

[08:46:51.328564] info: WinFormsAutoToolboxManagerService::IsToolboxVisible = False.

[08:46:53.424851] info: Shadow cache base directory: C:\Users\Mitrue\AppData\Local\Microsoft\VisualStudio\17.0_f167298e\WinFormsDesigner

[08:46:53.442837] info: [WinFormsApp1]: Preparing shadow cache folder.

[08:46:53.443876] info: [WinFormsApp1]: NetCoreServerLayout - Platform: AnyCPU, Normalized PlatformName: x64

[08:46:53.444882] info: [WinFormsApp1]: Copying design tools server common files from: 'c:\program files\microsoft visual studio\2022\enterprise\common7\ide\commonextensions\microsoft\windows.forms\DesignToolsServer\Common'.

[08:46:53.454656] fail: System.ArgumentException: パスに無効な文字が含まれています。

                       場所 System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)

                       場所 System.IO.DirectoryInfo.Init(String path, Boolean checkHost)

                       場所 Microsoft.WinForms.Utilities.Shared.ShadowCacheFolder.<CacheDirectoryAsync>d__5.MoveNext()

                    --- 直前に例外がスローされた場所からのスタック トレースの終わり ---

                       場所 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

                       場所 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

                       場所 Microsoft.DotNet.DesignTools.Client.Host.ServerLayout.<CopyServerToShadowCacheAsync>d__20.MoveNext()

                    --- 直前に例外がスローされた場所からのスタック トレースの終わり ---

                       場所 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

                       場所 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

                       場所 Microsoft.DotNet.DesignTools.Client.Host.ServerLayout.<CreateAsync>d__11.MoveNext()

                    --- 直前に例外がスローされた場所からのスタック トレースの終わり ---

                       場所 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

                       場所 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

                       場所 Microsoft.DotNet.DesignTools.Client.Host.ServerProcess.<CreateAsync>d__22.MoveNext()

                    --- 直前に例外がスローされた場所からのスタック トレースの終わり ---

                       場所 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

                       場所 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

                       場所 Microsoft.DotNet.DesignTools.Client.Host.ServerHostFactory.<CreateHostAsync>d__9.MoveNext()

                    --- 直前に例外がスローされた場所からのスタック トレースの終わり ---

                       場所 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

                       場所 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

                       場所 Microsoft.DotNet.DesignTools.Client.DesignToolsClientLoader.<CreateClientAsync>d__29.MoveNext()
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,399 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 32,696 Reputation points Microsoft Vendor
    2025-01-22T05:13:31.8733333+00:00

    Hello @,

    Welcome to Microsoft Q&A forum and thank you for sharing us the detailed error messages.

    To narrow down this issue, I suggest you create another new WinForm project, check if this error also appears in this newly created project.

    => If the same error doesn’t appear, the issue should be related to the specific project.

    Firstly, please close Visual Studio, navigate to your project folder, remove the bin, obj and the hidden .vs folder. Launch VS and rebuild your project, see if this error disappears.

    The error message indicates that there are illegal characters in the path, but don’t mention which path is. I suggest check your code and the project settings. Especially, the custom things such as custom controls, custom configuration files and form’s constructor(do you have any code which cannot be executed in design time, like database access, files access …?).

    Also, please open and check the XXXXX.Designer.cs file, make sure that there are no errors(red squiggly lines).

    => If the same error appears, the issue should be caused by Visual Studio or system environment.

    Try to repair Visual Studio from Visual Studio Installer => More => Repair. Reinstall the ".NET desktop development" workload in Visual Studio Installer. And manually download and install the .NET SDK from here: Download .NET.

    By the way, can this project be built correctly?

    Feel free to contact us.

    Best Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.