NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 250 forks source link

[Bug]: Toolbox Item Population problem from Referenced NuGet package (WPF, .NET, VS Professional 2017 Version 15.6.6) #11515

Closed hummpe closed 2 years ago

hummpe commented 2 years ago

NuGet Product Used

NuGet.exe, Visual Studio Package Management UI

Product Version

NuGet Package Manager 4.6.0, .NET Framework 4.6.1, Visual Studio Professional 2017 Version 15.6.6

Worked before?

No response

Impact

It's more difficult to complete my work

Repro Steps & Context

Toolbox Item Population problem from Referenced NuGet package (WPF, .NET, VS Professional 2017 Version 15.6.6)

Links used/information read in order to try and solve the issue: https://docs.microsoft.com/en-us/nuget/guides/create-ui-controls https://github.com/microsoft/xaml-designer-extensibility/blob/main/documents/toolbox-population.md

Versions: NuGet Package Manager 4.6.0 .NET Framework 4.6.1 Visual Studio Professional 2017 Version 15.6.6

Problem: After adding a VisualStudioToolsManifest.xml file to our NuGet package (containing a .dll with WPF User Controls) in the hopes of automatically upon installation of NuGet package populate the “XAML Designer/WPF” Toolbox with the items specified in the manifest-file – it does not. The Group/Tab is created upon installation of NuGet package, but it is empty (no items).

If we, instead of installing the NuGet package, copy the project containing the WPF User Controls into the solution and add a reference to it (Project -> Add -> Reference… -> Projects -> Check the checkbox for the project containing the WPF User Controls). The group AND the items appear. However, this functionality is exactly what we want when installing the NuGet package, and what we believed the VisualStudioToolsManifest.xml would help us with.

Also, if we go to the Toolbox, right click -> Choose Items -> Browse -> Navigate to the .dll that is installed with the NuGet package -> OK, the items are added to the Toolbox. Which should mean that there is nothing wrong with the .dll itself.

The NuGet package works in all other senses when installing (the custom controllers are shown in the XAML Designer view and the app compiles/runs with the custom controllers as expected).

The VisualStudioToolsManifest.xml looks like:

<FileList>
  <File Reference = "NameOfDLLFile.dll">
    <ContainsControls>True</ContainsControls>
    <ToolboxItems UIFramework="WPF" VSCategory="GenericGroup" BlendCategory="GenericGroup">
      <Item Type="Namespace.Namespace.NameOfControl" />
      <!—More Items-->
    </ToolboxItems>
  </File>
</FileList>

To summarize: The “GenericGroup” is created as a group/tab in the Toolbox, but it is empty.

Verbose Logs

Microsoft Visual Studio Professional 2017 
Version 15.6.6
VisualStudio.15.Release/15.6.6+27428.2037
Microsoft .NET Framework
Version 4.8.03752
Installed Version: Professional

Visual C++ 2017   00370-10003-57093-AA542
Application Insights Tools for Visual Studio Package   8.11.10402.2
C# Tools   2.7.0-beta3-62715-05. Commit Hash: db02128e6e3c4bdfc93e6ec425ac9162b4d4fe80
Command1 Extension   1.0
Common Azure Tools   1.10
Dotfuscator Community Edition   5.32.1.6167-6ce295ebd
IncrediBuild Build Acceleration   1.5.0.2
JavaScript Language Service   2.0
Microsoft JVM Debugger   1.0
Microsoft MI-Based Debugger   1.0
Microsoft Visual C++ Wizards   1.0
Microsoft Visual Studio VC Package   1.0

NuGet Package Manager   4.6.0

ProjectServicesPackage Extension   1.0
Syntax Visualizer   1.0
Visual Basic Tools   2.7.0-beta3-62715-05. Commit Hash: db02128e6e3c4bdfc93e6ec425ac9162b4d4fe80
WiX Toolset Visual Studio Extension   1.0.0.4
dominoFire commented 2 years ago

@hummpe Thanks for your report.

Can you try this on Visual Studio 2022 ?

nkolev92 commented 2 years ago

Hey @hummpe

Thank you for filling this issue.

Can you please try later versions of the product as @dominoFire suggested?

This issue is particular to Visual Studio, not NuGet in particular.

Please file this issue in https://developercommunity.visualstudio.com/, and it can be routed to the appropriate team.