views:

855

answers:

5

Is there anyway I can make the process of adding references to C# projects less painful?

Every time I create a new C# class library project. I have to use the Add Reference dialog for 5 times at least.

+3  A: 

You can select more than one reference at a time to add using CTRL-Click. You can also use the Recent tab to find references that you've added recently to other projects easily.

tvanfosson
+7  A: 

Install the PowerCommands for Visual Studio. You can then simply copy and paste a bunch of references between projects (plus lots of other useful commands). Some of the other useful commands are:

  • Collapse Projects (my favourite)
  • Copy References and Paste References
  • Remove and Sort Usings
  • Open Containing Folder
  • Open Command Prompt
Mitch Wheat
A: 

If you have certain references that you always add to a project then create a new project, add the references, get the project set up like you normally would, and then select File > Export Template. Then when you next want to create a new project, your newly-created template will be listed under the My Templates section.

A: 

You can install Resharper, last versions have improved usability if you mention some class in your code, but don't have reference to library with this class. In such case Resharper will offer you to add library reference and to import particular namespace. All you need to do is to click CTRL+Enter, and select from drop down menu "Reference library and import namespace". You will touch your keyboard only twice and Resharper will do the rest! Resharper really let you fully concentrate on writing good code without distraction with trifles.

Dmitry Lobanov
A: 

Hi,

Another way of doing this is to use Muse VSRefrences. This VSExtension has support for Copy and Paste references, also has fastest "Add GAC Reference" dialog

alt text

Give it a try and let me know if you have other questions

Muse VSExtensions