![]() |
General Programming »
Macros and Add-ins »
VS.NET Addins
Intermediate
Visual Studio 2005 Add-in that adds diff tools, an explore command, subversion support, and web project reportingBy Matthias HertelWith this add-in, you get new tools and commands that boost your productivity while developing, and some helpful reports especially for web projects. Version 1.0. |
C#, Windows, .NET 2.0VS2005, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
In Visual Studio .NET, I missed some useful commands and tools, 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 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 .NET 2.0 and Visual Studio 2005, of the original project that is still available at CodeProject.
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.
I've got several requests from users who where 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#.
This is the biggest change for building add-ins: 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 2005\AddIns". You might have to create this folder first if it doesn't exist yet.
When Visual Studio 2005 starts, it searches this path and will find the WebReports8.AddIn that holds all the additional information.
There are also other folders that can be used. You can see all the folders that are scanned in the Extra.Options dialog in the add-in section.
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. 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.
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, the 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.
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 29 May 2006 Editor: Smitha Vijayan |
Copyright 2006 by Matthias Hertel Everything else Copyright © CodeProject, 1999-2009 Web16 | Advertise on the Code Project |