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.

Value cannot be null. (Parameter 'rootComponent') when use IRootDesigner

See original GitHub issue
  • .NET Core Version: .NET 5 updated with VS2019 (Version 16.8.1) community build. net5.0-windows

  • Have you experienced this same bug with .NET Framework?: No

Problem description:

When I create the IRootDesigner myself component, open the deisnger of the component in VS 2019, it shows the error below.

Value cannot be null.  (Parameter 'rootComponent') 
Call Stack
at Microsoft.VisualStudio.WinForms.Protocol.Endpoints.Sessions.InitializeRootComponentResponse..ctor(IComponent rootComponent, IComponent[] components, String[] componentNames)
at WinFormsSurface.Handlers.Sessions.InitializeRootComponentHandler.HandleRequest(InitializeRootComponentRequest request)
at WinFormsSurface.Requests.RequestHandler`2.WinFormsSurface.Requests.IRequestHandler.HandleRequest(Request request) 

Then I create a sample from https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.design.irootdesigner?view=net-5.0 and open the deisgner of RootDesignedComponent it shows the same error!

20201116233302

The proejct use net5.0-windows as TargetFramework. and the Form1 inherit System.Windows.Forms.Form works fine but not the component!

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net5.0-windows</TargetFramework>
    <UseWindowsForms>true</UseWindowsForms>
  </PropertyGroup>

</Project>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
saferncommented, May 7, 2021

Thanks all for the info. I was able to reproduce this. Taking a deeper look now.

3reactions
ATECodercommented, Mar 18, 2021

I am seeing the exact same behavior. It is very easy to reproduce: (1) Add a new user control (use default name usercontrol1); (2) Hit Shift-F7–user control 1 displays in design mode; so far so good; (3) change public partial class UserControl1 : UserControl to public partial class UserControl1 : SplitContainer (2) Hit Shift-F7–error: Value cannot be null. (Parameter 'rootComponent')

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows Forms Designer error : Value cannot be null. ...
I am developing an app using C# Windows Forms with framework DevExpress. My IDE are Visual Studio Community 2022. It is all okay....
Read more >
"Value cannot be null. Parameter name: instance" error ...
I re-installed Telerik Reporting component, removed and added again DLLs and now is working fine.
Read more >
Value cannot be null. Parameter name - designerHost. ...
Hi Folks, I've implemented an XAF win app using SQL Server. I have one class file which contains the objects for the database,...
Read more >
SSAS – Error – Value cannot be null. Parameter name: ...
I got the following error as shown below, when I was adding rows into the XML file for the Data Source View.
Read more >
california state university, northridge
Thus came around the revised goal and problem to be addressed by this project: to create a program that could communicate with an...
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