Trying to add reference to project in Visual Studio 2012, "no items found" - windows

I'm trying to add a reference to System.dll and System.drawing.dll to my project in Visual Studio 2012. I'm doing this by right clicking the project, clicking "references", and then clicking "Add new reference".
It seems like the following screen should have a lot of options, but for me it simply says "No Items Found". In the screen it says my targeted framework is .NETFramework, Version=v4.0.
Is there anything else I need to be doing in order to make the options show up?

You need to enable CLR support in your application. You can do that in the properties of your project: Properties|General||Common Language Runtime Support: Common Language Runtime Support (/clr)

Related

Add ATL Simple Object in Visual Studio 2017

I am working with an old ATL/COM project in Visual Studio 2017.
In previous versions of Visual Studio you could select "Add Class" and then select the option "Add simple ATL object" to add a COM class to the project. This option appears to be completely missing in Visual Studio 2017.
Has the option been moved?
Have I missed an installation option?
Does Visual Studio fail to recognize my project as an ATL project? (It was created with a much older version.)
Or is this the end of the road for ATL?
I'm not sure whether this an answer, but it is too much for a comment and more than just an edit to the question.
I have tested on two systems, with
Visual Studio Community 2017, Version 15.1
Visual Studio Professional 2017, Version 15.3.2
and I believe that the functionality has changed between these two versions. I think it is unlikely to be a difference between the Community and Professional versions.
In both cases I created a new ATL project and tried three ways to add a class:
Add class... from the context menu in the Class View
Add class... from the context menu in the Solution Explorer
Add New Item... from the context menu in the Solution Explorer
With version 15.1, Add Class opens the following dialog, from which I can add an ATL Simple Object.
With version 15.3.2, Add Class opens the following dialog, without any option for an ATL Simple Object.
However, with version 15.3.2, Add New Item opens the following dialog, with a new option to create an ATL Simple Object, which was previously not available in this dialog.
So, it seems that the functionality has been moved. Curiously, it is no longer available in the Class View (which in my opinion is a mistake).
This problem is caused by changes in the project template and code wizard in version 15.3 of Visual Studio 2017.
The operation procedure has changed between version 15.2 or earlier and version 15.3 or later.
The blog article that explained this change is as follows.
Changes to Project Templates and Code Wizards in 15.3
Although it is described as an item in the release notes, there are few people who are watching, and details on how the actual is going on is unknown.
Visual Studio 2017 version 15.3 Release Notes
C++ Language Services
Project and Code Wizard
•We have rewritten several project and code wizards in the signature dialogue style.
•Add Class launches the Add Class wizard directly. All of the other items that were previously here are available under "Add > New Item".
•Win32 projects are under the Windows Desktop category in the New Project dialog.
•The Windows Console and Desktop Application templates now create the projects without displaying a wizard. There's a new Windows Desktop Wizard under the same category that displays the same options as before.
My experience with Visual Studio 2015 version 15.9.2 is that I had to uncheck Security Development Lifecycle (SDL) checks when I added an ATL Project, otherwise when I add the Simple ATL Object I get a messagebox with the error "did not find a .idl file in project name of my project".

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 "New Item" not showing all options

I have started a Cordova project with Visual Studio 2015. I don't know if this is standard behavior, but when I right click to add a new item, I get only few options. I wanted to add i.e "TypeScript json config file" aka tsconfig, but I don't get this option and I also fell like other many options are missing. This is a new computer and I don't know if I'm missing any kind of installation.
The options in the Add New Item dialog are different for Cordova projects, versus other projects like ASP.NET. The list you see here is what you get with Cordova projects. That being said - I'll forward this feedback along to our team (I'm part of the Visual Studio Cordova Tools team)!

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

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.

"Show Source of Selected Element Only" in Visual Studio 2003

There is a feature in Eclipse ("Show Source of Selected Element Only") which allows to view the code of the selected method only. All other part of the code is invisible.
I remember that a similar feature was available in Visual Studio 6.0. I would like to know if this feature is available in Visual Studio 2003 and up? If yes, please point out where to find this in the IDE.
This is not available in any one of the later releases. It was called "procedure view" in VS 6. Use outlining feature instead.

Resources