Web developer from Sydney Australia. Currently using asp.net, mvc where possible.

Sunday, September 25, 2011

Project to File Reference Switcher for Visual Studio

Switching from project to file references in visual studio has always been a pain. Once you add a project to the solution you have to go find all the locations the assembly is referenced by file path and remove and update to a project reference.

On top of playing hide and seek with references, the actual act of changing references is a slow and painful experience.

So I decided to experiment and write my first visual studio extension, "Reference Switcher"

Once installed it will sit patiently in the background and only activate when you add or remove a project from the solution.

When you add a project, it gets the assembly name defined by the project and then checks to see if other projects in the solution are referencing that assembly name. If they do, it will open a alert box (sorry, send a push request) and ask if you would like to switch the file reference to a project reference. Just hit OK and it will go ahead and switch all the references for you.

When you remove a project, it all happens in reverse. So any project references that it changed are restored back to the original file based reference.

Here are some screen shots of the extension in action:

1) Adding a existing project (existing projects have a file references to this one)

2) Shows projects that can be updated to use a project reference

3) Now the references have changed to Project References

4) When the project is removed, Reference Switcher confirms before changing the references back to there original location

5)Now the reference has changed back to a file reference

That's all there is to it. Small & simply but very handy.

The extension source can be found on git hub here:
Extension can be found in the gallery here:

Shout it

kick it on DotNetKicks.com


Jason said...

Very neat - looking forward to giving this a shot!

Gatesben said...

well said...pointable...
Hire iPhone Developers

Michael Reichenauer said...

Very nice. Have been locking for something like this for years. It will really make developing much easier when including external modules.
Found minor problem: The extension seems to have problem detecting references in projects located within solution folders (i.e. not file folders). Moving the projects out of the folders makes the extension work as expected.

David bone said...

Took me time to read all the comments, but I really love the article. It proved to be very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also engaged! I’m sure you had joy writing this article.singapore hotel deals

Inheritx Solutions said...

interesting article and impressive point of view, thanks

Ruby on Rails Development | Asp.net Development

geetha said...

Ecorptrainings.com provides ASP.NET in hyderabad with best faculties on real time projects. We give the best online trainingamong the ASP.NET in Hyderabad. Classroom Training in Hyderabad India

Unknown said...

I have known many information from this. i like this post.

Thanks for sharing.

Mechanical Seals

Unknown said...

Nice program!!! Used it a lot!

Any plans on upgrading it to vs 2012?

hellanadam said...

I wondered upon your blog and wanted to say that I have really enjoyed reading your blog

posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
ios App Development Company
Android App Development


Mobile App Development


Sandeep SEO said...

This is both interesting and relevant. We see this sort of thing regularly. You are doing a great job................Visit our Training Institute website for Oracle Fusion Courses.

Rajesh said...

you are providing such a valuable information about studying..and also have some good key points for every student.
Oracle Financials Training in Hyderabad

Unknown said...

nice article! very useful information. Keep sharing this kind of valuable blogs regularly. to hire web development team- click here

Unknown said...


Unknown said...

Thanks for posting the article on oracle apps. I am new for this website I feel happy reading this post. Keep posting more blogs on Oracle. For more details about Oracle R12 Financials, please Click Here

Sannihitha Technologies said...

thanks for sharing information
OBIEE Training in hyderabad

Rainbow Training Institute said...

Thank you for sharing your awesome and valuable article this is the best blog for the students they can also learn.

Workday Online Training

Rainbow Training Institute said...

Very interesting blog Really excellent information and thank you for giving your valuable information

Workday HCM Online Training

Rainbow Training Institute said...

Thank you for sharing such a nice and interesting blog and really very helpful article

Workday Online Training

Rainbow Training Institute said...

Very interesting blog Really excellent information and thank you for giving your valuable information

Oracle Fusion HCM Online Training