How to add a reference in Visual studio 2010
Last time i add the reference from a plugin who work great but what i do if i want to do that in a visual studio without any plugin
in visual studio go to project choose add reference and their is no good way to add more plugin like search easily and add them.
i find the way to add that after open the add reference window choose .net tab and if you want to suppose
Microsft.Csharp then their is no search button or way to find them whenever listing have a thousands of thins their. so in this condition choose any of component and type Microsoft then they move to a plugin who start With Microsoft. if you press anything wrong then type backspace many time to sure that Microsoft is removed start again Microsoft.
are this is not wired to add the component like many software have facelity to search when list have thousands of thing their preharps in Visual studio these thing goes hard to do that.
very hard to do tha开发者_JS百科t when a list of plugin goes removed and you want to add them in your project.
Well Are their any trick you have when you not have any plugin and you want to do that easily.
i myself spent a time but problem not totally destroy as i want.
what is the best way or practice you use to add the reference in Visual studio
System.Net.Mail is a part of System.Net. Are you sure you are not just missing the using statement, to include the namespace in your code file?
using System.Net.Mail;
Try adding that at the top of the file.
On "trick" also is if you have added the reference, but not the using statement, and you write the class name you want to use in your program. Right click it, and choose Resolve. The first option under resolve adds the using statement at the top for you automatically. The second one prefixes the class name with the namespace for you.
EDIT
I checked again just now, and System.Net.Mail is actually inside the System assembly, and not System.Net. I assume that you have System referenced already, but on my VS2010, I can include System.Net.Mail as long as I have referenced System (and that is, of course, done by default). Have you tried creating a new project, and just tried adding using System.Net.Mail without doing anything else?
Visual Studio add-ins like Visual Assist X, Resharper of CodeRush will help you with this.
With either of these add-ins, you just use the class you want to use eg. FileInfo. The add-in detects this and understands you probably mean System.IO.FileInfo and offers you to add the namespace reference with one click (or offers you multiple namespaces if there is an ambiguity).
If you have added the System reference, then you will also have the System.Net.Mail namespace by default.
Type using System. at the top of your class & you will see the list of included namespaces
I would recommend the Productivity Power Tools extension from Microsoft, which replaces the Add Reference dialog box with one you can search for references in, as well as a number of other features.
Anirudha,
I've created a tool that will help you to achieve your goal. Muse VSReferences will allow you to add a Global Assembly Cache reference to the project from Add GAC Reference menu item.
Regards...
Muse Extensions
精彩评论