dotnet / dotnet/winforms

Some times ToolBox not populated with user control from Nuget

Open
#8,360 2 comments 0 reactions 2 assignees Claimed by @merriemcgaw View on GitHub
area-VSDesigner
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
1d 13m
Merged PRs (30d)
85

Description

### Environment

Microsoft Visual Studio Community 2022
Version 17.4.2
VisualStudio.17.Release/17.4.2+33122.133
Microsoft .NET Framework
Version 4.8.09032

### .NET version

.Net6 .Net7

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

No

### Issue description

This also coming from our [discussion](https://github.com/KlausLoeffelmann/NetControlDesigners/pull/6#issuecomment-1336462914) with @KlausLoeffelmann.
Working on porting [chart control designer](https://github.com/kirsan31/winforms-datavisualization/tree/DesignerTest) I ran into the following issues.

In the solution I have control itself and test WinForms project that reference nuget package of the control. So we must have 2 controls on ToolBox (one from project and one from nuget):
![image](https://user-images.githubusercontent.com/17767561/203862352-4a0f36ad-87ba-47c1-a929-ba33b1bbee4a.png)

1. Some times ToolBox not populated with Nuget control version (the control from project is always here).
- Even when we have not see control from nuget, when we drug project control version - all client/server staff are working, so it's only ToolBox problem.
- Need to restart studio (sometimes many times) until it shows up.
2. Not a bug but very annoying. The client side of the control designer is loading and caсhing on first opening of the test project form in the designer. After that if you have modified client side, you **need** to restart VS to see this changes. I have test project with `*` reference to package and more of it with nuget restore before build - this not help. Designer populate and cache ToolBox only on first load (even close and reopen solution not helps). May be add some way to reload / repopulate ToolBox manually? It's also helps with previous bug :)

### Steps to reproduce

1. Pull https://github.com/kirsan31/winforms-datavisualization/tree/dev
2. Build.
3. Open `Form1` from `DesignerTest` project in designer and see on TooLbox.
a. If you see only
![image](https://user-images.githubusercontent.com/17767561/203863403-f3687942-a62b-432a-b83c-b0da3c0d3724.png)
here - you've got it :)
b. If you see both versions - restart VS and do point 3. Repeat (sometimes the bug appears immediately, sometimes it takes about 10 restarts) until you see only one.

### Diagnostics

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.