Visual Studio do not add my component (from a DLL) to the toolbox even if I reference it - visual-studio-2010

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.

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.

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

The way I found to make this working is:
Add the dll, reference it
Compile the project
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)

Like said above,
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.
I save it and close the client project.
I restart Visual Studio 2012 and reopen the client project. Now the custom control is in the Toolbox.
I reopen the custom control project, make some modifications and compile.
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".

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.)

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
Reference the user control library
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)?

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).
Place the .ddl file in any Library Solution
Then I add that .ddl as reference to my needed project
Build the project and restart the Visual Studio
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
I dragged the .dll and dropped under that text and then all my custom tools appeared in my toolbox.

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.

Related

Unable to browse to include reference in a Visual Studio C++ DLL project - any way to get around this?

I'm creating a DLL using C++ in Visual Studio 2015. I started my project by following these instructions.
I need to add a reference to my project so I can make use of an API and, unlike C# DLL projects (for example), I'm unable to access the Browse tab when clicking on Project > Add Reference.
According to this page this is because:
The number of tabs available at the top of the Add Reference dialog
box can vary, depending on the type of project open and the resources
it is using. C++ native projects contain only a Projects tab.
Why is there this restriction and is there any way to get around it?
EDIT: I've just found a solution here but I'm new to Visual Studio and I'm not sure how to set 'the CLR option' and then remove after adding my reference. If anyone can explain how to do this I would be very grateful!
I'm a little late to the party, but I recently encountered a similar problem and have a fix that might help the OP or others in the future.
Problem Overview:
Open the Visual C++ project[1] in Visual Studio[2]. In the top toolbar, click on "Project > Add Reference..." . In the window that pops up, there is no "Browse" button/option (see image No Browse option).
Solution:
In the top toolbar, click on "Project > Properties"[3]. In the left navigation panel of the window that pops up, click on "Configuration Properties > General" (this will probably be selected by default). In the right panel, click on "Project Defaults > Common Language Runtime Support". The field value should read "No Common Language Runtime Support" (see image No /clr). Using the drop-down menu in the Common Language Runtime Support field (the grey down-arrow box), select "Command Language Runtime Support (/clr)". Apply the change. The Property Page should now look like this. Click "OK" to close the Property Page. Now, when you go to add a reference, the window that shows up will have a "Browse..." button and look like this. If you want to subsequently remove CLR support[4], select the "No Common Language Runtime Support" option and apply the changes.
Notes:
[1] As you're probably aware, you can select from various project types when creating a new project in VS. I experimented with most of the Visual C++ project types included under the Visual C++ template. Since the problem -- lack of "Browse" option when adding references -- seems to be related to CLR support, you will encounter this problem in all Visual C++ project types that are not created as Visual C++ CLR projects. Thus, if you want avoid the problem from the get-go, consider creating a CLR project from the start.
[2] I was able to replicate the problem in Visual Studio 2015, 2017, and 2019; the same solution works for all versions.
[3] Before changing any Configuration Properties, use the Configuration drop-down list in the top-left of the Property Page to select which configuration you would like to change the properties for, e.g. Debug, Release, All.
[4] If you have added references after turning on CLR support, then turning off CLR support is dubious as suggested by #Cody Gray in the comments to the original question. I have not tried to build a project after doing something like this so I can't speak to the solution suggested here. My answer is just to tell you how to change the CLR support.
For C++ projects, you need to get all the projects into the same solution and then when you go to Add Reference you'll see the other projects listed. You then just check the box to 'add the reference'. Keep in mind that this will cause the import library of the DLL (or a static library for a non-DLL library project) to link against your target project. It will not add any include paths you might need to get to the import headers for your DLL.
DirectX Tool Kit has instructions for adding project-to-project references for a C++ project that you might find useful to read over. See here.
For some general background on C++ project-to-project references. See this Visual C++ Team blog post which was published when they were updated for Visual C++ 2010.

Visual Studio 2010 Toolbox Is Empty

My toolbox is empty.
Obviously, I'm not the first. I read this question and this other question, but that didn't help.
I click here...
I get this window...
With instructions that say: "...Drag an item onto this text, to add it to the toolbox..."
Sounds good; from where do I get such items to drag?
The toolbox is empty because there is no project loaded.
The toolbox is populated with tools/controls according to the type of the current project. The controls are different for MFC than they are for ASP.NET, for example. If you haven't loaded any project, Visual Studio can't populate the toolbox.
Either open an existing project, or go to File -> New Project to create a new one.
Have you tried right-clicking on it and selecting the "Reset Toolbox" option? You can also try to manually add specific tools to it by using the "Choose Items..." option.
A common suggest is also to go into the Visual Studio 2010 Directory and delete all of the .tbd files within the following directory (Related) :
C:\Documents and Settings\Local Settings\Application Data\Microsoft\VisualStudio\10.0"
Although if neither of these options work, you will really want to consider possibly reinstalling / repairing Visual Studio.
Is your project running? I noticed that my toolbox is empty when I am debugging the project. Try stopping debugging.

Visual Studio 2012 project lost link to TFS

So I came back to a project that I was working on a few months ago, and when I load it one of the projects seems to have lost the link to it's entry in TFS. The solution explorer doesn't show the lock icons for it, but I still see it in TFS.
I tried performing a add to source control but it says that the items already exist.
Anybody have ideas on how to fix this?
I'm trying to avoid remapping because there are a few branches, and I'm not even sure that will fix it.
Your solution has lost the TFS binding, you can do the following to fix it. First open the solution/project you wish to bind in Visual studio then:
Highlight the project or solution you wish to bind to Team Foundation version control in Solution Explorer.
On the File menu, click Source Control, and then click Change Source Control.
3.In Change Source Control dialog box, click Bind.
MSDN Link
Update for VS 2013 (thank you Caad9) - In VS 2013 [Ultimate at least] there's an additional level in the menu; File - Source Control - Advanced - Change Source Control... which brings up the dialog

How to add TFS bindings to a Visual Studio 2010 project?

There's a question already discussing how to add project/solution bindings to TFS, however it seems to only apply to Visual Studio 2008 (I am unable to find the "Change Source Control" dialog in VS2010).
I have a solution and source code on my local machine already in TFS, however it does not have TFS bindings (the thing that produces the padlock icon in the Visual Studio Solution Explorer and allows automatic checkout).
How can I add bindings to an existing TFS project using Visual Studio 2010?
In VS2010 check Tools>Options>Source Control and see if set to TFS. If not that might be why you don't see File->Source Control->Change Source Control.
I ran into this problem and, for me, the issue was that my solution was offline with respect to TFS. Upon trying to change source control, I received a message stating that it is already associated with source control but is offline. I placed the solution on-line, per my recollection, using the File->Source Control->Go Online menu option and this seemed to fix the problem.
Go to the source control explorer under Team Explorer, where you can see your repository. Right click on the top folder that maps to the folder on your local machine. There's an option called "Map to local folder". Map this to the folder on your local machine. This will set up all the bindings for TFS for your project.
I had the same problem and the following steps solved it for me in VS 2008.
Unfortunately, I didn't record the exact steps and don't want to add a new project to our TFS to try again, so the steps are from memory.
Go to File Menu -> Source Control -> Open from source control
Select solution file from TFS hierarchy
Accept any warning about project already being on local disc
A popup dialog comes up saying something along the lines "This solution is already under source control, but no bindings exist. Do you want to add them?"
A selector shows all projects in a grid and allows adding the required bindings. Add TFS server setting to each project (select all lines in grid at once and press a button at the top. I can't remember what it was called, but it was fairly obvious).

How do I install component designers in Visual Studio?

If I add [DesignerAttribute("somenamespace.mycomponentdesigner, mydesignerlibrary.dll")] to the top of a class and then install that class into the tool palette, how do I then get the mydesignerlibrary.dll installed into VS so that VS can find the designer?
This page describes the process you'd need to follow, but effectively you'd need to:
Copy the designer assembly into a folder and configure Visual Studio to search that path by creating a registry entry under HKLM\Software\Microsoft\.NETFramework\<version>\AssemblyFoldersEx, where <version> is the lowest framework version your designer assembly is compatible with.
Note that your control projects target the earliest version of the Framework that your control will support. This is referred to as the minimum Framework version. A restart of Visual Studio is needed before the new search path can take effect.
Copy the runtime assembly into another folder; add your custom controls to Toolbox. This can be done either manually through “Choose Items…” dialog or programmatically with a Toolbox installation package.
You can do it using Toolbox in the Visual Studio.
In the toolbox window, click right button on the mouse and choose menu 'Choose Items', then you use 'Browse' button for adding your dll component, then you can see it in the toolbox window in the Advanced Section(in the bottom).

Resources