Repository navigation
Open
Description
Environment
Microsoft Visual Studio Enterprise 2022 (64-bit) - Preview
Version 17.10.0 Preview 1.0
.NET version
.NET 8.0
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
Did this work in a previous version of Visual Studio and/or previous .NET release?
Can't recall it worked
Issue description
Following commands were already exceuted.
Add-MpPreference -ExclusionProcess 'devenv.exe'
Add-MpPreference -ExclusionProcess 'DesignToolsServer.exe'
However, closing Visual Studio and reopening seems to solve the issue.
Steps to reproduce
- Create a Windows Forms Application
Diagnostics
[09:49:13.627374] info: Creating VsDesignerLoader
[09:49:13.718618] info: [Thread 1] Creating design-time ITypeResolutionService.
[09:49:13.756584] info: Start processing enqueued assemblies
[09:49:13.756584] trce: Loaded Microsoft.WinForms.DesignTools.Protocol in 00:00:00.0000078 [thread 69]
[09:49:13.757587] trce: Processed 'Microsoft.WinForms.DesignTools.Protocol' in 00:00:00.0008524
[09:49:13.759587] info: Added 'Microsoft.WinForms.DesignTools.Protocol'
[09:49:13.759587] trce: Loaded Microsoft.WinForms.DesignTools.Client in 00:00:00.0000059 [thread 69]
[09:49:13.765588] trce: Processed 'Microsoft.WinForms.DesignTools.Client' in 00:00:00.0053722
[09:49:13.766587] info: Added 'Microsoft.WinForms.DesignTools.Client'
[09:49:13.781584] info: BasicDesignerLoader.BeginLoad - Setting _loadDependencyCount to 0.
[09:49:13.783619] info: BasicDesignerLoader::BeginLoad - Calling AddLoadDependency
[09:49:13.787620] info: VsDesignerLoader::PerformLoad - Calling AddLoadDependency.
[09:49:13.790601] info: BasicDesignerLoader::BeginLoad - Calling DependentLoadComplete
[09:49:14.051632] info: Visual Studio culture: en-US (0x0409)
[09:49:14.051632] info: [Thread 10] Launching server...
[09:49:14.056631] info: Is processor architecture ARM64: False
[09:49:15.460926] info: Added 'mscorlib'
[09:49:15.460926] trce: Loaded System.Windows.Forms in 00:00:00.0000202 [thread 70]
[09:49:15.463925] trce: Processed 'System.Windows.Forms' in 00:00:00.0028683
[09:49:15.480926] info: Added 'System.Windows.Forms'
[09:49:15.480926] trce: Loaded System in 00:00:00.0000111 [thread 70]
[09:49:15.481923] trce: Processed 'System' in 00:00:00.0007721
[09:49:15.500607] info: Added 'System'
[09:49:15.500607] trce: Loaded System.Drawing in 00:00:00.0000076 [thread 70]
[09:49:15.500607] trce: Processed 'System.Drawing' in 00:00:00.0000938
[09:49:15.502608] info: Added 'System.Drawing'
[09:49:15.502608] trce: Loaded System.Design in 00:00:00.0000071 [thread 70]
[09:49:15.516231] trce: Processed 'System.Design' in 00:00:00.0142382
[09:49:15.527923] info: Added 'System.Design'
[09:49:15.527923] trce: Loaded System.Drawing.Design in 00:00:00.0000115 [thread 14]
[09:49:15.527923] trce: Processed 'System.Drawing.Design' in 00:00:00.0001963
[09:49:15.527923] info: Added 'System.Drawing.Design'
[09:49:16.329565] fail: OutputGroupService didn't return output group DesignerRuntimeImplementationProjectOutputGroup.
For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
[09:49:16.329565] fail: Could not retrieve DesignerRuntimeImplementationProjectOutputGroup for current project.
For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
[09:49:16.337555] fail: System.InvalidOperationException: Designer load encountered an error. Please ensure that the project can be built successfully.
at Microsoft.DotNet.DesignTools.Client.Host.ProjectInfoProvider.NetCore.<GetNetCoreProjectInfoAsync>d__6.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.ProjectInfoProvider.<GetProjectInfoAsync>d__9.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__8.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__29.MoveNext()
For information on how to troubleshoot the designer refer to the guide at https://aka.ms/winforms/designer/troubleshooting.
[09:49:16.359110] info: VsDesignerLoader::PerformLoad::LoadCompletionTask - Calling DependentLoadComplete.
[09:49:16.366109] warn: Cannot update selection in server process as Session is not connected.
Reacted by kirsan31 and Dai
Metadata
Metadata
Assignees
Labels
area-VSDesignerWindows Forms out-of-proc designer related issues

Activity
Zheng-Li01 commentedon Mar 8, 2024
@jaliyaudagedara The Form Designer can load and successfully with same Visual Studio version as below screenshot, could you please share more details with us to reproduce & investigate the issue?

jaliyaudagedara commentedon Mar 12, 2024
@elachlan,
I am extremely sorry for the delay in responding.
Hmm, that's interesting. This is what I am seeing.

Let me see what else I can provide.
jaliyaudagedara commentedon Mar 12, 2024
When I close the solution and open the solution back, it works. This is the output I am getting.
And I can see the
DesignerToolsServeris running in Task Manager. But when I create a new project,DesignerToolsServeris not there in Task Manager, so it's failing to start for some reason.jaliyaudagedara commentedon Mar 12, 2024
Updated Visual Studio to
Visual Studio 17.10 – Preview 2Same error!

But with more information this time.
Call Stack,
Zheng-Li01 commentedon Mar 13, 2024
@jaliyaudagedara , thanks for your response. still cannot reproduce it with latest Dev17 17.10.0 Preview 2.0 with .NET SDK 8.0.200, which bring in Visual Srudio, and .NET SDK 8.0.202 from https://dotnet.microsoft.com/en-us/download/dotnet/8.0 on win11 OS, the Form designer working well as below GIF. not sure what is the difference between you and me caused the issue. could you please have a try to repair or re-install the visual studio to see if which can work well?
Note: Did the same things on the win10 OS, which have the same results that the Form Designer working well.

.NET SDK 8.0.200
.NET SDK 8.0.202

jaliyaudagedara commentedon Mar 13, 2024
I have repaired Visual Studio, still the same :(.
I am on

Windows 11 Pro for Workstations:Not sure whether screen resolution matters:

A key thing is, when the solution is closed and re-opened, it works.
What's the difference? Isn't Stacktrace helpful?
Let me know if you want any specific logs from any internal folder.
jaliyaudagedara commentedon Mar 13, 2024
I have reported the issue through
Visual Studio Developer Community, captured all the logs, and included them in the report.Issue: Windows Forms Designer not loading: System.InvalidOperationException: Designer load encountered an error. Please ensure that the project can be built
P.S: there were a lot of reports for the issue. Seems I am not the only one who faced this issue and it has been happening for a couple of years.
kirsan31 commentedon Mar 18, 2024
Today got same problem but with existing old test .Net6 project. I've changed
<TargetFramework>net6.0-windows</TargetFramework>tonet8.0-windowsin text editor and then launch VS. And designer not loading with exactly errors like here. More of it restart doesn't help. Then I decide to post here, changed WinFrorms VS logs to Information and restart VS once again - and designer was opened fine 🤷♂️Subsequent experiments failed to reproduce the problem :(sgf commentedon May 8, 2024
Please open VS2022 with administrator privileges first, and then open the solution from the VS project list, and the problem will disappear.
Although we can temporarily solve the problem in this way, VS2022 does have this bug, and the team has not fixed this problem yet. And this bug has existed for several years, but it has specific trigger conditions, and this trigger condition is unclear.
We still hope the team can fix this bug if possible.
figuerres commentedon May 13, 2024
YES! very strange!
i also will note that in the project that when run normally the form does not get a form.resx file created due to the crash.
but after creating a new form then visual studio creates the .resx file that goes with the form.
also the project structure is different from dot net 4.xx vs dot net core 8
i suspect that some details of the creation of a windows forms app with dot net 8 need to be checked out .... some privilege issues and what files to create in what locations are not fully right .....