Closed nathan130200 closed 2 years ago
@Shyam-Gupta / @RussKie can you guys take a look here and map it to the issue in designer repo?
Hello, someone?
Linking the similar bugs together #6492. I am guessing they both have same root cause.
@nathan130200 Could you please share Windows EventVwr
logs for DesignToolsServer.exe
when this issue occur.
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.
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.
Add-MpPreference -ExclusionProcess 'DesignToolsServer.exe'
@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:
Its a fresh winforms project.
Also in taskmgr don't show up, DesigntToolsServer trying to start
Once its crash first time, design tools server don't attempt to start again even if i open any form/control.
@nathan130200 Thank you so much for sharing the videos. The error regarding DesignerRuntimeImplementationProjectOutputGroup
is different. Due to this error, WinForms designer will not try to launch DesignToolsServer
process. Also it tries to launch process for the first time designer is opened. Subsequent closing and reopening of designer will not trigger DesignToolsServer
process launch.
I created a new Windows 10
virtual machine and installed Visual Studio 2022, 17.0.5 version
. I created both net5.0-windows
and net6.0-windows
projects 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\debug
directory ? If it fail then check EventVwr
for 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
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.
@nathan130200 Earlier designer was copying all the files present in project output directory to a temp folder from where DesignToolsServer
process 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 2
or newer versions and share your feedback.
Happened in Current(stable) sersion visual studio 2022 with a C#(net6.0-windows) project and I believe it is the same issue. In current: open solution, open designer, looks fine but some attributes drag down menu shows nothing (imgur), then after some seconds VS crashes.
After switching to Preview(17.1.0 Preview 3), it shows
at Microsoft.DotNet.DesignTools.Client.Host.ServerProcess.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.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.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.d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.DotNet.DesignTools.Client.DesignToolsClientLoader.d__28.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.<>c__DisplayClass24_1.<<-ctor>b__1>d.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.d__26.MoveNext()
C:\Users\masah>"c:\Program Files\dotnet\dotnet.exe" --list-runtimes
Microsoft.AspNetCore.App 6.0.1 [c:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.13 [c:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.1 [c:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.13 [c:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.1 [c:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
I solved this by removing this section from the csproj file:
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
In my situation, i just type dotnet new winforms
and used default csproj created, nothing different packages, and still same problem.
An workaround is close and reopen entire solution to make designer works, but isn't correct specially for big projects.
@nathan130200 I wasn't able to repro on my machine - dotnet new winforms
works perfectly and the project loads just how I'd expect. That said, we are increasing the timeout before DesignToolsServer gives up. Hopefully that will help your situation, and it will be out in the next Preview or 2. We're also spinning up some investments around diagnostics and helping both our users and us collect the information we need to troubleshoot problems. Keep checking out each new Preview and things will improve.
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
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.
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.
Hi @nathan130200, it looks like you just commented on a closed issue. The team will most probably miss it. If you have a question - consider opening a new discussion thread. Alternatively, you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.
.NET Core Version: .NET 6.0.100
.NET Info Command
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
Sometimes in Output window only display first line:
[16:30:43.1921519] Creating VSCodeDomDesignerLoader
dotnet new
command targeting windows desktop:Steps i tried:
None of these worked.
https://user-images.githubusercontent.com/14365254/147392615-cd09e099-d44e-48f6-b807-8a4855b5901b.mp4