question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Creating a new WinForms project in .NET 6 in Version 17.3.0 Preview 2.0 breaks the designer for Form1.cs

See original GitHub issue

Environment

Version 17.3.0 Preview 2.0

.NET version

 Version:   6.0.400-preview.22301.10
 Commit:    25580ffe7a

Běhové prostředí:
 OS Name:     Windows
 OS Version:  10.0.19043
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.400-preview.22301.10\

Host (useful for support):
  Version: 6.0.5
  Commit:  70ae3df4a6

.NET SDKs installed:
  5.0.203 [C:\Program Files\dotnet\sdk]
  6.0.400-preview.22301.10 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Did this work in a previous version of Visual Studio and/or previous .NET release?

yes it worked in some previous VS 2022

Issue description

Create a new project from template. image

The error says ensure that the project can be built but it can. ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

It is unclear what the problem is.

Call stack is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE>.MainHeaderText { font:0.8em Segoe UI; color:#FFFFFF; font-weight:bold; }.MainHeaderErrorNumberText { font:0.7em Segoe UI; color:#000000; }.MainHeaderWhyText { font:0.8em Segoe UI; color:#FFFFFF; text-decoration:underline; cursor:pointer; }.MainHeaderIgnoreText { font:0.8em Segoe UI; color:#FFFFFF; text-decoration:underline; cursor:pointer; }.MainHeaderBackground { background-image:url('C:\Users\janse\AppData\Local\Temp\tmpB16F.tmp.gif'); background-repeat:repeat-x; background-color:#434E5E; }.ErrorHeaderErrorText { font:0.7em Segoe UI; color:#000000; font-weight:bold; }.ErrorHeaderGoToCodeText { font:0.7em Segoe UI; color:#000080; text-decoration:underline; cursor:pointer; }.ErrorBodyTitle { font:0.8em Segoe UI; font-weight:bold; color:#000080; }.ErrorBodyLink { font:0.8em Segoe UI; color:#007ACC; text-decoration:underline; cursor:pointer; }.ErrorBodyLinkNoSizing { color:#007ACC; text-decoration:underline; cursor:pointer; }.ErrorBodyText { font:0.8em Segoe UI; color:#000000; }.ErrorBodyCallStack { font:0.7em Segoe UI; color:#000000; }.ClickableCell { cursor:pointer; }.HasVisuallyDistinctBorder { border:none; }</STYLE>
</HEAD>
<BODY bgColor=#1a1a1a>
<TABLE role=document id=CollapseBody0 class=HasVisuallyDistinctBorder 
cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff>
<TBODY>
<TR role=presentation>
<TD bgColor=#ffffff>
<TABLE role=document cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR role=presentation>
<TD><!--StartFragment-->
<TABLE role=document cellSpacing=0 cellPadding=0>
<TBODY><TR role=presentation id=CallStackBody0_1>
<TD class=ErrorBodyCallStack>at 
Microsoft.DotNet.DesignTools.Client.Host.ProjectInfoProvider.NetCore.<GETNETCOREPROJECTINFOASYNC>d__6.MoveNext()<BR>--- 
End of stack trace from previous location where exception was thrown ---<BR>at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()<BR>at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task 
task)<BR>at 
Microsoft.DotNet.DesignTools.Client.Host.ProjectInfoProvider.<GETPROJECTINFOASYNC>d__9.MoveNext()<BR>--- 
End of stack trace from previous location where exception was thrown ---<BR>at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()<BR>at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task 
task)<BR>at 
Microsoft.DotNet.DesignTools.Client.Host.ServerHostFactory.<CREATEHOSTASYNC>d__7.MoveNext()<BR>--- 
End of stack trace from previous location where exception was thrown ---<BR>at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()<BR>at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task 
task)<BR>at 
Microsoft.DotNet.DesignTools.Client.DesignToolsClientLoader.<CREATECLIENTASYNC>d__29.MoveNext()<BR>--- 
End of stack trace from previous location where exception was thrown ---<BR>at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()<BR>at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task 
task)<BR>at 
Microsoft.DotNet.DesignTools.Client.DesignToolsClientLoader.&lt;&gt;c__DisplayClass25_1.&lt;&lt;-ctor&gt;b__1&gt;d.MoveNext()<BR>--- 
End of stack trace from previous location where exception was thrown ---<BR>at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()<BR>at 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task 
task)<BR>at 
Microsoft.DotNet.DesignTools.Client.DesignToolsClientLoader.<GETCLIENTASYNC>d__27.MoveNext() 
</TD></TR></TBODY></TABLE>
<TABLE role=document cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR role=presentation>
<TD><BR></TD></TR></TBODY></TABLE><!--EndFragment--></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>

Steps to reproduce

Create a new WinForms project

Diagnostics

No response

Workarounds

  • open/close Visual Studio fixes the issue

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
RussKiecommented, Jul 26, 2022

Without additional diagnostics there’s nothing we can do further. If you see this issue occur again please ping here or raise a new issue. Thanks.

0reactions
janseriscommented, Jul 25, 2022

@RussKie

I can’t repro the issue.

OK I thought it would work for everyone because it was just clicking new project in that VS version and I got the error immediately and I got two likes which I thought means that two more people experienced this as well.

" why are you unable to share the diagnostics?

as I wrote I don’t have that version installed anymore because it’s been 14+ days and my environment has changed.

I can’t use a preview version now because of lack of disk space and this is not a priority problem for me because I can work in regular VS. I just wanted to let you know

If you cannot reproduce it with that VS version, we can close the issue. Maybe it is not even present in the current preview (anyways, new and new VS 2022 previews are released every week or two because of MAUI team not being able to patch MAUI runtime and SDK in a different way)

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's new in Windows Forms .NET 6
This article describes some of the new Windows Forms features and enhancements in .NET 6. There are a few breaking changes you should...
Read more >
VS2019 form designer doesn't show
To view the form designer in .NET Core Winforms project, please install the latest VS 2019 Preview version and selected the 'Use the...
Read more >
Winforms in .NET Core 6.0 issue with VS 2022
In my case, the problem seems to be adding a second class in the form class file. Workaround: Define the new class in...
Read more >
Intro to Windows Forms (WinForms) in .NET 6
Windows Forms, also known as WinForms, is one of the original project types in .NET. It is designed to be a rapid application...
Read more >
How to Port Desktop Applications to .NET Core 3.0
Porting main project. Create new project. Create new application of the same type (Console, WinForms, WPF, Class Library) as the application you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found