Visual Studio do not add my component (from a DLL) to the toolbox even if I reference it
Asked Answered
E

9

17

As stated in the title, I copied my DLL in Visual Studio project, set it to "content" and "copy always". Added a reference to this DLL and set it to "copy locally".

I successfully managed to instance my component to a form through code but it doesn't appear in the toolbox, really boring.

How can I solve this issue?

If I link directly the DLL project to this project it works, but now I'm treating the DLL as "external" so it's not part of the same solution of the DLL project.

Epineurium answered 7/1, 2011 at 0:53 Comment(0)
E
5

The way I found to make this working is:

  1. Add the dll, reference it
  2. Compile the project
  3. Save the solution and restart visual studio

And then controls show up in toolbox (not always working, I think is a sort of visual studio bug)

Epineurium answered 21/7, 2011 at 9:0 Comment(1)
I must admit that an F5 of some sort probably is better but they didn't give an option...Epineurium
H
16

I had this problem with @AndrewFinnell's solution:

There are no components in 'c:....\XXXX.dll' that can be placed on the toolbox.

So I solved with drag and drop:

  • open Windows explorer and navigate to the DLL
  • drag the DLL and drop it on Visual Studio in the Toolbox, exactly where you want your components to appear.

I also realized that some components may have compatibility issues with certain .NET Framework versions. For instance A Professional Calendar/Agenda View That You Will Use seems not to work with .NET 4.5, while it does with .NET 4.

Headrace answered 19/12, 2013 at 15:29 Comment(0)
K
12
  • Right-click in the toolbox.
  • Click "Choose Items..."
  • Click "Browse..."
  • Navigate to your DLL and click Open
  • Then click "Ok"

Your components should then show up

Klayman answered 7/1, 2011 at 1:4 Comment(5)
It gives me an error about using [Offset] attribute, I use it but the dll works... visual studio bug?Epineurium
@Fire I wouldnt write it off as a Visual Studio bug without exhausting other avenues. Are you sure your property isn't throwing when accessed?Klayman
I'm sure, it works definitely (is a C# wrapper for a C lib that shows bmps on my G19 display), I'm testing it on this project (the one with the problem) and totally works without throwing anything...Epineurium
this way usually works for me, but just today VS reports that the dll doesn't contain any components to add. However many times I scream at the monitor telling it it does contain a Usercontrol, it still does't work.Immovable
2024 and your advice is still valid. Thank you.Ouzo
E
5

The way I found to make this working is:

  1. Add the dll, reference it
  2. Compile the project
  3. Save the solution and restart visual studio

And then controls show up in toolbox (not always working, I think is a sort of visual studio bug)

Epineurium answered 21/7, 2011 at 9:0 Comment(1)
I must admit that an F5 of some sort probably is better but they didn't give an option...Epineurium
I
1

Like said above,

  1. I reference the DLL in the client project by: in Solution Explorer right click > Add Reference, at this time the custom control doesn't appear in the Toolbox.

  2. I save it and close the client project.

  3. I restart Visual Studio 2012 and reopen the client project. Now the custom control is in the Toolbox.

  4. I reopen the custom control project, make some modifications and compile.

  5. And the most important, all changes that I made in the DLL project automatically were updated in the client project without need to redo "Add Reference".

Idiom answered 24/5, 2013 at 11:25 Comment(0)
H
0

Here is what I did.

After install the net 3.5 chart download from MSDN link, I manually copied the 3.5 chart dlls to my project and refer to them. Then, from the "choose item" of toolbox, browse to the dlls and add them into toolbox. Make sure the checkbox is checked for the "chart" in the "choose item" popup.

After these, the "chart" item in the toolbox should be available and enabled for .NET 3.5 project.

NOTE (I am using Visual Studio 2010. I think my solution should work for 2012.)

Hasid answered 16/1, 2015 at 17:6 Comment(0)
G
0

I was having this same issue. I am working in Visual Studio 2010.

My user control library is written in C# and my project I'am importing it into is in Visual Basic.

If I had the C# project in my solution, the custom user controls would show up automatically. But if I only referenced the DLL it would not load the custom user controls from the referenced library into the "Toolbox".

The above post that mentions finding the file in explorer and dragging and dropping it into the toolbox solved the problem. This is a very strange way of behaving. VB user control libraries don't require this step.

This has been an issue I have had sitting on the burner for the last 2 years.

I would up-vote the previous answer but I don't have enough rep yet.

This post could use some better tags, cause it was buried on most of my google searches.

So

  1. Reference the user control library
  2. Drop the DLL file into the tool box.

One question I have in regards to this is: what happens if you change the project reference to the DLL (because it moved) and not attempt to update the toolbox reference (by removing the control from the toolbox and dragging and dropping the DLL from the new location)?

Grasso answered 28/8, 2015 at 16:11 Comment(0)
A
0

I tried following the other answers (thanks to all of you!), but I got this problem and I'll let you all know how I solved it and show my custom tools in toolbar (in VS 2017).

  1. Place the .ddl file in any Library Solution
  2. Then I add that .ddl as reference to my needed project
  3. Build the project and restart the Visual Studio
  4. Then, when I look into toolbox, my custom toolbox name appears in toolbar, when I expand that I got below message

    There are no Usable controls in this group. Drag an item onto this text to add in to toolbok

    enter image description here

  5. I dragged the .dll and dropped under that text and then all my custom tools appeared in my toolbox.

Allotrope answered 26/10, 2017 at 5:23 Comment(1)
sorry for bumping. but this is what i have actually noticed with one of the .dll library i'm using. i can't seem to import it to my toolbox if its not in any solution files \bin\debug or \bin\release folder. quite a hassle to be honest.Lading
A
0

And add lib. to folder in your solution example solutionfolder/bin/debug and then add reference to object from this folder, finally rebuild, quit, come back, drag and drop dll from this solutionfolder/.../../ and it will probably appear.

Assemblyman answered 11/4, 2019 at 11:17 Comment(0)
W
0

Using VS 2017. Tried all the answers without success. Finally I browsed to the .dll using file explorer, right-clicked and copied it, then right click and paste on General in the toolbox. Joy to the world - it worked for me!

Whirly answered 2/8, 2023 at 20:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.