Winforms: Winforms designer still broken on every version since VS 16.4

Created on 30 Apr 2020  路  12Comments  路  Source: dotnet/winforms

We have had various updates on the winforms designer for net core but it keeps breaking or changing.

Using the 'workaround' on the following link did work on earlier versions of VS but is now no longer working with latest VS versions. https://github.com/dotnet/winforms/blob/master/Documentation/winforms-designer.md

Now broken again on VS 'Version 16.6.0 Preview 5.0' and 'Version 16.5.4'

Please can someone give an update when this is likely to work? There has been very little feedback since December 2019 and I'm wondering whether to wait until May 2020 where it might work or abandon Winform netcore projects altogether.

Latest bug is as follows

Cannot find the requested resource: '207'.    

Instances of this error (1)  

1.   Hide Call Stack 

at Microsoft.VisualStudio.CommonIDE.ResourceLoader.TryEachApplicableNamespace[T](String resourceName, GetResourceDelegate`1 getResource)
at Microsoft.VisualStudio.CommonIDE.ResourceLoader.GetString(String resourceName, Int32 lcid)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.InvisibleEditor..ctor(IServiceProvider serviceProvider, String filePath, IVsHierarchy hierarchyOpt, Boolean needsSave, Boolean needsUndoDisabled)
at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.TextManagerAdapter.CreateTextPoint(FileCodeModel fileCodeModel, VirtualTreePoint point)
at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.InternalElements.AbstractCodeElement.get_StartPoint()
at EnvDTE.CodeClass.get_StartPoint()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.CodeTypeDeclarationFromCodeClass(CodeClass vsClass)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnNamespacePopulateTypes(Object sender, EventArgs e)
at System.CodeDom.CodeNamespace.get_Types()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.Parse(TextReader codeStream)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.MergedCodeDomParser.System.CodeDom.Compiler.ICodeParser.Parse(TextReader stream)
at System.CodeDom.Compiler.CodeDomProvider.Parse(TextReader codeStream)
at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.Private.VSCodeDomDocDataAdapter.get_CompileUnit()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)  
waiting-author-feedback VS designer

Most helpful comment

I hope you all check out 16.7 Preview 1, lots of issues have begun to be ironed out. We're bringing more features in for Preview 2 (and beyond of course). The only issue we've seen repeated mentions of recently is the ToolBox corruption which can be fixed by resetting your ToolBox or following more detailed instructions. Check out @OliaG's blog post for details about what is in our current Previews and the comments for an alternative solution to the the ToolBox issue.

All 12 comments

Is it happening on all your projects? Because on our projects all are ok (16.5.4). For example, you can try this test project.

Hi @cirrusone we've been working hard to make some very fundamental changes in how the designer works and there are regular updates each month which unblock new scenarios. Why we have to make such fundamental changes in how the designer works is that Visual Studio devenv.exe is running as a .NET Framework process, but we want the user to be able to visualize changes, properties, and controls that are only available in .NET Core. So we're having to add a new .NET Core process and have it communicate with all the .NET Framework pieces that are Visual Studio. This requires cross-process communication and parenting of windows across processes. Lots of fun things!

If you provide feedback using the VS feedback system we will be able to help you a bit more, and if it's a scenario we haven't enabled just yet getting feedback that it is blocking a customer will help us prioritize your scenario. Let us know the repro steps as well as anything particularly unique about your projects and that will help even more.

Have no fear, we're making more progress each Preview and as @kirsan31 mentioned, many projects are already able to work in the designer. If you're using 3rd party control libraries you may need to wait for them to provide .NET Core versions to get things to work.

@kirsan - your example project works fine this end.

I think the issue is I'm using a 3rd party datagrid. However, we tested an initial MVP using the same datagrid and the 'workaround' file nesting method and it worked with no issues. Latest versions of VS it no longer works which is a little frustrating.

We are still in progress for enabling 3rd party controls. We are working with control vendors to define the best way to develop Core controls that work in the designer. Even then, you control vendor will most likely need to update their code for complex 3rd party designers to work.

@merriemcgaw I think, that main point of @cirrusone was:

why original .net designer stop working for his <TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks> projects in release versions of VS since 16.4?

Also, I have a question: after new core designer will be released, what will be the principle of selecting designer version (.net/core) for such projects <TargetFrameworks>net472;netcoreapp3.1</TargetFrameworks>? Currently preview of VS always uses .net designer. Never mind, already got it.

Currently preview of VS always uses .net designer.

Are you sure, did you try reordering them and putting .NET Core first? When I'm debugging (F5) it seems to pick the first TF from the list, so maybe the designer does the same.

Currently preview of VS always uses .net designer.

Are you sure, did you try reordering them and putting .NET Core first? When I'm debugging (F5) it seems to pick the first TF from the list, so maybe the designer does the same.

Ah sorry - got it: you need to close+open solution to changes in order of net472/netcoreapp3.1 take affect...

Can you please provide VS feedback? This stack doesn't show the Core Designer loaded at this point. First try changing the order, and if it continues to cause problems can you please provide VS feedback so that we can collect diagnostic data to help route the problem to the right place?

I hope you all check out 16.7 Preview 1, lots of issues have begun to be ironed out. We're bringing more features in for Preview 2 (and beyond of course). The only issue we've seen repeated mentions of recently is the ToolBox corruption which can be fixed by resetting your ToolBox or following more detailed instructions. Check out @OliaG's blog post for details about what is in our current Previews and the comments for an alternative solution to the the ToolBox issue.

This submission has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 14 days.

It will be closed if no further activity occurs within 7 days of this comment.

I know that this is not the right place, but...
After upgrading to VS 16.7 original designer stop working with visual inheritance. The work is blocked - need reverting to 16.6 (((
I have reported an issue (spent about 1.5 hours fighting with developercommunity errors):
https://developercommunity.visualstudio.com/content/problem/1141229/winforms-designer-not-load-forms-with-visual-inher.html
@RussKie can you assist something?

@kirsan31, somehow your ticket got routed incorrectly and didn't hit my radar until now. @Shyam-Gupta and the team will take a look at what is happening. Now that we have the direct ticket link it's on my radar and we'll prioritize looking at it. Thanks so much for your patience!

Was this page helpful?
0 / 5 - 0 ratings