Repository navigation
Closed
Labels
area-VSDesignerWindows Forms out-of-proc designer related issues
Description
-
.NET Core Version:
.NET 6.0.100 -
.NET Info Command
SDK do .NET (refletindo qualquer global.json):
Version: 6.0.100
Commit: 9e8b04bbff
Ambiente de runtime:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: c:\program files\dotnet\sdk\6.0.100\
Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa
.NET SDKs installed:
5.0.207 [c:\program files\dotnet\sdk]
6.0.100 [c:\program files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.10 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [c:\program files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.10 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [c:\program files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.10 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0 [c:\program files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download- Have you experienced this same bug with .NET Framework?:
No
Problem description:
Attemt to open winforms designer on NET6 fail everytime.
If i both add <TargetPlatforms>net472;net6.0-windows</TargetPlatforms> for both net6.0-windows and net472, the designer open, but open old .NET Framework designet (that works too for .net 6), but i must be forced to reference net framework in csproj.
Since .net core/net 6 desktop support, the designer NEVER WORKED.
Expected behavior:
Open winform designer.
Minimal repro:
Create empty winform project on VS2022 and try open Form1 designer.
Output from VS2022:
[16:30:43.1921519] Creating VSCodeDomDesignerLoader
[16:30:45.1771483] Processed 'System.Design' in 00:00:04.1270162
[16:30:45.2051489] Added 'System.Design'
[16:30:45.2051489] Loaded System.Drawing.Design in 00:00:00.0000212 [thread 10]
[16:30:45.2091460] Processed 'System.Drawing.Design' in 00:00:00.0042542
[16:30:45.2101469] Added 'System.Drawing.Design'
[16:30:45.3011495] Start processing enqueued assemblies
[16:30:45.3021480] Loaded Microsoft.WinForms.DesignTools.Protocol in 00:00:00.0000206 [thread 10]
[16:30:45.4881486] Processed 'Microsoft.WinForms.DesignTools.Protocol' in 00:00:00.1868933
[16:30:45.4941472] Added 'Microsoft.WinForms.DesignTools.Protocol'
[16:30:45.4951483] Loaded Microsoft.WinForms.DesignTools.Client in 00:00:00.0000363 [thread 87]
[16:30:45.7031461] Processed 'Microsoft.WinForms.DesignTools.Client' in 00:00:00.2081947
[16:30:45.7081489] Added 'Microsoft.WinForms.DesignTools.Client'
[16:30:54.2412176] [CraftMonitor]: Preparing shadow cache folder
[16:30:54.2442114] [CraftMonitor]: Copying design tools server common files from: 'c:\program files\microsoft visual studio\2022\preview\common7\ide\commonextensions\microsoft\windows.forms\DesignToolsServer\Common'
[16:31:03.1555740] [CraftMonitor]: Copying design tool server platform-specific files from: 'c:\program files\microsoft visual studio\2022\preview\common7\ide\commonextensions\microsoft\windows.forms\DesignToolsServer\x64'
[16:31:03.3375745] [CraftMonitor]: Copying 'C:\Users\natha\source\repos\CraftMonitor\CraftMonitor\obj\Debug\net6.0-windows\CraftMonitor.designer.deps.json' to 'DesignToolsServer.deps.json'
[16:31:03.3495751] [CraftMonitor]: Copying 'C:\Users\natha\source\repos\CraftMonitor\CraftMonitor\obj\Debug\net6.0-windows\CraftMonitor.designer.runtimeconfig.json' to 'DesignToolsServer.runtimeconfig.json'
[16:31:03.6065745] [CraftMonitor]: Launching design tools server process...
[16:31:14.6486408] [CraftMonitor]: Timed out while connecting to named pipe: DesignToolsServer.f02e0df7-a9d3-43a5-952b-8d79b383c9b1
[16:31:14.9206458] Microsoft.DotNet.DesignTools.Client.ServerException: Timed out while connecting to named pipe.
at Microsoft.DotNet.DesignTools.Client.Host.ServerProcess.<ConnectToStreamAsync>d__30.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.Host.ServerProcess.<LaunchAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.Host.ServerHostFactory.<CreateHostAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.DesignTools.Client.DesignToolsClientLoader.<CreateClientAsync>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)Sometimes in Output window only display first line:
[16:30:43.1921519] Creating VSCodeDomDesignerLoader
- CSProj file created by
dotnet newcommand targeting windows desktop:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>Steps i tried:
- Reinstall VS and .NET SDK
- Open both regular version or preview from VS2022
- Reopen file
None of these worked.
3jRwY9y3qk.mp4
Reacted by aquinn39
Metadata
Metadata
Assignees
Labels
area-VSDesignerWindows Forms out-of-proc designer related issues

Activity
dreddy-work commentedon Dec 27, 2021
@Shyam-Gupta / @RussKie can you guys take a look here and map it to the issue in designer repo?
nathan130200 commentedon Jan 13, 2022
Hello, someone?
dreddy-work commentedon Jan 13, 2022
Linking the similar bugs together #6492. I am guessing they both have same root cause.
Shyam-Gupta commentedon Jan 13, 2022
@nathan130200 Could you please share
Windows EventVwrlogs forDesignToolsServer.exewhen this issue occur.foller commentedon Jan 14, 2022
I had the same problem today.
By taking a good look at the errors and things I messed with before the error started happening. I verified that it is looking for the file from the temp folder. One of my projects has a reference to a project with a higher version and that caused an error when loading the logger. I tested it by deleting the contents of the Temp folder and creating a new project. That solved the problem. I went back in the project and removed the references to packages with a higher version. I deleted the data from the temp folder and ran it again. Worked perfectly.
Before that I had tried reinstalling windows, installed VS 2022, went back pc updates and nothing worked.
The solution was to upgrade the project's version from .net 5 to .net 6 or remove the reference project with the highest version and delete the contents of the temp folder.
Bajotumn commentedon Jan 14, 2022
I was able to successfully work around this issue for myself and my team in a 110 project solution.
We added the DesignToolsServer.exe to Windows Defender exceptions so that it is not slowed down by the system call hooks Defender uses to provide real-time protection. The issue has not gone away completely but is now only a minor inconvenience since once the server has started it persists for the lifetime of the Visual Studio run.
nathan130200 commentedon Jan 14, 2022
@Shyam-Gupta i had same issue, first time show exception "Timeout while connecting remote pipe", next time i try open form, don't show up any logs, neither on Windows Event Viewer also:
sigWZTKt8g.mp4
Its a fresh winforms project.
nathan130200 commentedon Jan 14, 2022
Also in taskmgr don't show up, DesigntToolsServer trying to start
6jAXTGIfZs.mp4
Once its crash first time, design tools server don't attempt to start again even if i open any form/control.
Shyam-Gupta commentedon Jan 15, 2022
@nathan130200 Thank you so much for sharing the videos. The error regarding
DesignerRuntimeImplementationProjectOutputGroupis different. Due to this error, WinForms designer will not try to launchDesignToolsServerprocess. Also it tries to launch process for the first time designer is opened. Subsequent closing and reopening of designer will not triggerDesignToolsServerprocess launch.I created a new
Windows 10virtual machine and installedVisual Studio 2022, 17.0.5 version. I created bothnet5.0-windowsandnet6.0-windowsprojects but couldn't repro the issue. Hence I think there is something in the environment I am missing.Please let me know if you have other Visual Studio versions installed side by side on the same machine. You mentioned that the error reproes even for new WinForms projects. Let me know if you are using Visual Studio new project creation wizard or dotnet.exe command line tool to create the project.
Do you see any error if you create a 6.0 WinForms project, build it and then try to launch the project exe directly from its
bin\debugdirectory ? If it fail then checkEventVwrfor errors.In mean time, I will try to add more diagnostic logs in the product and get back.
Thanks again for working with me to get to the root cause of this problem.
FYI: @merriemcgaw
nathan130200 commentedon Jan 16, 2022
I just have VS2022 preview installed, also i did some tests, if i close and reopen project DesignToolsServer was able to start. But its a bit confused. I think isn't supposed to i be forced to close/reopen project, specially some big projects that take some times to load.
Also building and running directly from .exe or debugging inside VS works fine, just designer don't start at once.
Shyam-Gupta commentedon Jan 18, 2022
@nathan130200 Earlier designer was copying all the files present in project output directory to a temp folder from where
DesignToolsServerprocess gets launched. But in 17.1 Preview 2 we have made improvements in this scenario and only a small subset of files, which are essential for the designer, will get copied. It will reduce the overall time taken to launch the designer especially for large projects\solutions.Hence I request you to try the scenario in
17.1 Preview 2or newer versions and share your feedback.7 remaining items
nathan130200 commentedon Jan 27, 2022
The problem, is VS don't launch design tools server for the first time, idk what cause this. But at second time (after unload/reload entire solution), vs was able to copy design tools server and start.
The first time, VS attempt to connect to design tools server pipe, without begin started, so this cause "Timeout connecting to named pipe" because VS is waiting for connection to IPC, but since IPC never was requested to start for first time then cause exception.
Like i've said this happened since they release winforms for .net core, i was unable to start any project that uses winforms and new winforms designer (that i think is DesignToolsServer).
I will try record again to show.
I will wait for next preview and test if was solved, seems to be internal problem on visual studio not proper launching design tools server
merriemcgaw commentedon Jan 27, 2022
Thanks for the update. Given that this isn't happening to everyone I'm very curious about why it is happening on your installs. We will be adding more logging coverage and other diagnostic services so that we can better figure out what is impacting our customers. We'll let you know when that work is in a Preview so we can test it out together.
RussKie commentedon Feb 3, 2022
As an update.
As a tactical fix we have increase the connection timeout from 10 seconds to 2 minutes. This fix is expected to land in 17.1p5. The team is also working on a more strategic solution, that includes better error reporting and diagnostics, and perf improvements.
Update designer-related docs, add designer troubleshooting guide
Update designer-related docs, add designer troubleshooting guide
Update designer-related docs, add designer troubleshooting guide
Update designer-related docs, add designer troubleshooting guide
Update designer-related docs, add designer troubleshooting guide