question

hahayes-0824 avatar image
0 Votes"
hahayes-0824 asked AnnaXiu-MSFT answered

error after changing main form name in windows forms

204578-capture.png


vs-generalwindows-forms
capture.png (23.7 KiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

In Solution Explorer, open the form to the node under Designer.cs and look for errors.

204758-000000.png


1 Vote 1 ·
000000.png (3.7 KiB)

error:
at System.ServiceExtensions.GetRequiredService[TService,TInterface](IServiceProvider provider)
at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.VSCodeDomDocDataAdapter.g__CreateCodeDomProvider|19_0()
at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.VSCodeDomDocDataAdapter.get_Provider()
at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.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 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)

0 Votes 0 ·

1 Answer

AnnaXiu-MSFT avatar image
0 Votes"
AnnaXiu-MSFT answered

Hi @hahayes-0824 ,

Welcome to Microsoft Q&A!

Which version of Visual Studio are you using? What is the target framework of your Windows Forms project?

Please update your Visual Studio to the latest version.
Then, launch your VS and create a new Windows Forms project.
Before renaming the form, please close all tabs in code editor.
Trying to rename again and check if the error disappears or not.

Sincerely,
Anna


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.