Click here to Skip to main content
15,881,380 members
Articles / Programming Languages / C#

Visual Studio 2010 Add-in that Adds Diff Tools, Web Project Reporting and Some Subversion Support

Rate me:
Please Sign up or sign in to vote.
4.56/5 (13 votes)
12 May 2010CPOL4 min read 162.9K   2.7K   98   18
With this add-in, you get new tools and commands that boost your productivity while developing, and some helpful reports especially for web projects - Version 2.2

Introduction

Some years ago, I missed some useful commands and tools in Visual Studio, so I started developing macros and add-ins for this development environment. This project started with some special web reports, and grew up to a collection of useful tools that help in developing and controlling my work and files. The result was an add-in for Visual Studio 2003 that adds commands for comparing files and folders, an explore command, and some useful reports for web projects.

Now, this version is a port to Visual Studio 2010 (may also run with VS 2005 and VS 2008), of the original project that is still available at CodeProject.

There you can find a lot of the implementation details still valid for this version. The main difference between Visual Studio 2003 and the newer versions is the registration and setup of new Add-ins that is significantly easier by using a *.addin file that describes all installation parameters.

After installing, there are new commands available in the command window as well as in the context menu of the Solution Explorer. Most of them use a new Tool window to output the results of the commands and to offer new functionalities in the context of the reported items.

If you are interested in detailed descriptions, see the original article. Here, I want to give some hints that were useful while porting the original project, that might help you to port yours.

The Diff Code

I've got several requests from users who were searching for a diff algorithm. So, the C# code that is used to compare two files can now also be found as a separate CodeProject project: An O(ND) Difference Algorithm for C#.

Manual Setup

This is the biggest change for building add-ins with Visual Studio 2005 and beyond: there is no more need for COM registrations and registry hacks!

All you need to start using this add-in is to extract all the files from the WebReports8_setup.zip archive to the folder "C:\Documents and Settings\[your name]\My Documents\Visual Studio 2010\AddIns". You might have to create this folder first if it doesn't exist yet.

When Visual Studio starts, it searches this path and will find the WebReports8.AddIn that holds all the additional information.

For older versions of Visual Studio, there are appropriate folders available.

There are also other folders that can be used. You can see all the folders that are scanned in the Tools.Options dialog in the add-in section.

Changed Libraries

Visual Studio .NET 2003 shared some libraries for handling the menu part with the Office products. This is no longer true, and the import of Microsoft.Office.Core is obsolete.

Now, you have to use the namespaces EnvDTE80 and Microsoft.VisualStudio.CommandBars. The EnvDTE90 and EnvDTE100 namespace was not necessary for building the Add-in, so you can remove it from the included namespaces if you build a new Add-in on your own.

There are some minor differences between the old and the new libraries, but the overall functionality is the same. There is still some casting of the COM types necessary.

Most of the code changes are in the Connect.cs class that handles the registration, and is called by the Visual Studio 2005 events.

Developing the Addin File

Don't get confused (I got) with the 2 *.addin files that are generated by the wizard. Only the one that is located in the Visual Studio 2010\Addins folder is relevant and it's the one that is linked from the project but is not stored in the project folder. Here you can edit all the stuff that needs to be set up. I recommend to delete the one in the project while developing and saving a copy to the project folder, when everything runs fine.

Resources

Resources can now be built into managed satellite DLLs. You will not need a C compiler any more to create an empty DLL that will hold the resources.

There are some good articles on that topic, and of course, MSDN helps a lot: Creating Managed Satellite DLLs.

I have added the batch file buildRes.bat to the sources that help calling the resgen and other tools.

resgen.exe Icons.resx
al.exe /t:lib /embed:icons.resources 
       /culture:en-US /out:Webreports8.resources.dll

md bin\en-us
copy WebReports8.resources.dll bin\en-us

rem -- cleanup --
del WebReports8.resources.dll

The resx files can be edited by VS.NET.

I actually created two DLLs because they are language specific and I wanted to support English and German.

The project also contains a postBuild script that copies all the files that are used at runtime to the addins folder. If you compile the project by yourself, you should check this script and change the path to the addins folder to your specific installation and username.

Helpful Links

History

  • 2010.05.09 - Version 2.2 - Version for Visual Studio 2010
  • 2006.05.27 - Version 1.1 - German resources added
  • 2006.03.21 - Version 1.0 - Some fixes (as suggested by Carlos Quintero)
  • 2006.01.31 - Version 0.9 - Just a port to the new Visual Studio environment

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Deutsche Bank AG
Germany Germany
see https://www.mathertel.de

Comments and Discussions

 
QuestionThis Add-in works for VS2008 ? Pin
Pablo B.17-Jul-08 7:50
Pablo B.17-Jul-08 7:50 
GeneralRe: This Add-in works for VS2008 ? Pin
mediademon13-Jan-09 4:19
mediademon13-Jan-09 4:19 
GeneralCongratulations and please allow an off-topic add-in question Pin
Alexandru Matei4-Dec-06 10:05
Alexandru Matei4-Dec-06 10:05 
GeneralRe: Congratulations and please allow an off-topic add-in question Pin
joshcoady16-Jan-07 10:25
joshcoady16-Jan-07 10:25 
GeneralRe: Found the reason of my problem Pin
Alexandru Matei16-Jan-07 20:45
Alexandru Matei16-Jan-07 20:45 
GeneralVS 2005 SP1 Pin
joshcoady16-Jan-07 21:51
joshcoady16-Jan-07 21:51 
GeneralRe: VS 2005 SP1 Pin
Alexandru Matei16-Jan-07 22:06
Alexandru Matei16-Jan-07 22:06 
Generalnice example... Pin
User 17912922-May-06 23:04
professionalUser 17912922-May-06 23:04 
GeneralBUG: it breaks other add-ins Pin
Carlos J. Quintero16-Mar-06 22:27
Carlos J. Quintero16-Mar-06 22:27 
NewsRe: BUG: it breaks other add-ins Pin
Matthias Hertel17-Mar-06 10:40
professionalMatthias Hertel17-Mar-06 10:40 
GeneralLicense Pin
Phil Crosby2-Mar-06 11:54
Phil Crosby2-Mar-06 11:54 
JokeRe: License [modified] Pin
Matthias Hertel4-Mar-06 6:24
professionalMatthias Hertel4-Mar-06 6:24 
GeneralPath may not be correct Pin
bailes1-Feb-06 10:02
bailes1-Feb-06 10:02 
NewsRe: Path may not be correct Pin
Christopher Scholten8-Mar-06 5:36
professionalChristopher Scholten8-Mar-06 5:36 
AnswerRe: Path may not be correct Pin
Matthias Hertel2-Jun-06 9:59
professionalMatthias Hertel2-Jun-06 9:59 
AnswerRe: Path may not be correct Pin
Christopher Scholten5-Oct-06 22:27
professionalChristopher Scholten5-Oct-06 22:27 
GeneralEmpty menu Pin
z33z1-Feb-06 9:08
z33z1-Feb-06 9:08 
AnswerRe: Empty menu Pin
Matthias Hertel2-Jun-06 10:02
professionalMatthias Hertel2-Jun-06 10:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.