Contents tagged with Visual Studio
-
Vortrag über Visual Studio Extensibility in Leipzig
Am nächsten Freitag, 6.7.2007, bin ich um 19:30 bei der .NET User Group Leipzig zu Gast und halte dort einen Vortrag über Visual Studio Extensibility.
Die Themen des Vortrags an diesem Abend:
- Code Snippets
- Project/Item Templates und Wizards
- Makros
- Add-ins
Ein gewisser Schwerpunkt wird beim Thema Visual Studio Add-ins liegen, wo ich u.a. auf den einen oder anderen Fallstrick hinweisen werde, über den ich bei der Entwicklung von GhostDoc gestolpert bin.
Die Teilnahme ist kostenlos, eine Anmeldung ist erforderlich. Laut dem Organisator Torsten Weber laufen die Anmeldungen gut, noch ist aber Platz für weitere Interessierte.
-
GhostDoc 2.1.0 Released
<summary>
GhostDoc is a free add-in for Visual Studio that automatically generates XML
documentation comments for C#. Either by using existing documentation inherited
from base classes or implemented interfaces, or by deducing comments from
name and type of e.g. methods, properties or parameters.
</summary>Quick Facts
- Support for VB.Net added
- Full support for events, including inherited documentation and user-defined custom rules.
- Download on the GhostDoc Website
- Users of earlier versions: Please read the ReadMe on upgrading!
About this Release
For Visual Basic developers, version 2.1 is what 2.0 should have been: VB.Net support has been added again. Even though I got help (huge thanks to Daniel Root for the translation of the demo project), I spent more time than I wanted on testing, debugging and deployment – in the end it’s a huge number of small things that add up.
C# developers who have to implement many interfaces with events (like I do) will enjoy the full support for events, as it includes a text generation rule for using inherited documentation (VB.Net developers benefit from this of course, too).
What’s New in GhostDoc 2.1.0:
- Added: Support for Visual Basic .NET has been added again (was disabled in version 2.0.0), but still is regarded as "experimental". The feature is turned off by default and you have to turn it on in the configuration dialog. Please see the docs for more information.
- Added: The setup for the demo project now contains a VB.Net version.
- Added: Full rule support for events (configurable default documentation, inherited documentation e.g. for interface implementations, and used-defined custom rules)
- Added: New macro
$(DeclaringTypeKind)
that specifies the kind of type a member is defined in (i.e. class, struct or interface). - Changed: All occurrences of "class" in the default templates have been replaced by
$(DeclaringTypeKind)
. - Changed: As the next version of Visual Studio (codename "Orcas" ) will be named Visual Studio 2008, all texts have been updated accordingly.
- Fixed: Documentation of constructors of structs referring to the initialization of a "class" instance.
- Fixed: Problems with parameter names starting with an '@' (e.g. "@class").
-
GhostDoc 2.0.0 Released
<summary>
GhostDoc is a free add-in for Visual Studio that automatically generates XML
documentation comments for C#. Either by using existing documentation inherited
from base classes or implemented interfaces, or by deducing comments from
name and type of e.g. methods, properties or parameters.
</summary>Quick Facts
- Support for Vista out of the box
- Support for Orcas (tested: Beta 1)
- Better support for generics, more language elements, new rules, new macros
- Download on the GhostDoc Website
- Users of earlier versions: Please read the ReadMe on upgrading!
(The file is contained in the ZIP file)
About this Release
Version 2.0 is the first real feature release for a long time. Originally intended to be a minor update to fix installation problems on Windows Vista (and to be called 1.9.6), it ended up much larger than I had planned. In the second week of April I had the opportunity for almost one week to work exclusively on GhostDoc, so I used the time to implement the features I was missing the most in my everyday, non-GhostDoc-related work. Along the way I was able to implement a few of the external feature requests waiting in my issue tracking database.
What then followed was what could best described as deployment hell, but I must admit that I was being extra ambitious, targeting a simultaneous release of (separate) versions for Visual Studio 2005 and Orcas plus Vista compatibility (which in my case required a little more than simply patching an MSI). Building and testing setups plain sucks, period. No matter how careful you plan things (very carefully), how much automated your build process is (very automated) or how intensely virtual machines are used (very intensely) – the moment you modify a working setup, you’re doomed. There’s always one more typo, one more slight problem; it seems as if you’re never finished.
OK, enough rambling of a tired developer, here’s the good stuff:
What’s New in GhostDoc 2.0.0:
- Added: Support for Visual Studio codename "Orcas". Note that GhostDoc for Visual Studio 2005 and GhostDoc for Visual Studio "Orcas" are released in separate setups and have to be installed into separate folders. Both offer equal functionality and thus share the same configuration file, though. This will stay this way as long as GhostDoc 2.x is released both for 2005 and "Orcas".
- Added: Support for generic methods. The type parameters are now documented using the
<typeparam>
tag. For type parameter names starting with 'T' (e.g. "TKey") documentation text is generated (e.g. "Type of the key"), for all other type parameter names the text is left empty. Note that this behavior is currently hard-coded. - Added: New text generation rules for classes, interfaces and structs (with support for generic type parameters). The default rules generate empty summaries and place the cursor so you can start typing the summary immediately. It is possible to change the summary template to insert e.g. the class name split into individual words, but honestly I don't want to ship GhostDoc with that behavior by default as I didn't find it too helpful. In addition to the default rules, it's also possible to define custom rules (e.g. for classes with a name ending on a specific suffix).
- Added: A new macro
$(End)
for specifying the location of the text cursor after the documentation text has been generated. - Added: A new macro
$(Rule)
that inserts the display name of the rule that generated for documentation text. Useful for debugging custom rules, this macro can e.g. be used in the custom text that is added to new doc comments (see the last tab of the GhostDoc configuration dialog). - Added: A macro of the format
$(%VarName%)
inserts the value of the environment variable with the name "VarName" (or an empty string if no variable with that name exists). - Added: A few language elements are now supported with limited functionality, i.e. without specific rule types (new rule types may be added in future versions, but they didn't have a high priority to be included in 2.0 as the existing functionality already helps a lot):
- enums - empty summaries for the enum and all of its values
- enum values - empty summary
- events - summary starting with "Occurs when"
- delegates - empty summary
- variables - empty summary
- Added: New method rules:
- A rule for
Dispose(bool disposing)
- A rule for overloaded operators
- Rules for implicit/explicit conversion operators
- A rule for
- Added: Before upgrading or importing a configuration, it is now possible to quickly create a backup copy by clicking the link in the lower left of the dialog. This is useful especially during an upgrade installation.
- Changed: The experimental support for VB.Net has been disabled in this release. I was pretty tight on my time budget and couldn't spend any time on keeping support for C# and VB.Net in sync.
- Changed: The demo project is no longer installed to a sub-folder of the GhostDoc directory (where it caused problems when working with a non-admin account). Instead, the demo project is now an optional feature with its own setup, suggesting an installation path in the user's Visual Studio project folder.
- Fixed: Error message when installing GhostDoc by double-clicking the MSI file on a Vista system.
- Fixed: When defining custom rules, conditions for method and type names didn't work well with type parameters (generics).
- Fixed: The "Document this" command worked only when the cursor was positioned in a specific way. This has been relaxed, the cursor may now also be positioned on the whitespace before the language element (in the same line as the identifier), or somewhere inside the documentation comment.
Update 2007–05–02: Please guys, please read the instructions on upgrading in the ReadMe!
-
Folien für "Visual Studio anpassen und erweitern" online
Am Montag waren Jens Schaller und ich bei der .NET User Group Paderborn zu Gast, um einen Vortrag über Anpassung und Erweiterung von Visual Studio 2005 zu halten. Wir hatten ingesamt 15 Zuhörer, angesichts des tollen Wetters eine durchaus erfreuliche Zahl.
Die Folien für die Vorträge liegen nun zum Download bereit (PowerPoint 2007, PowerPoint 2003).
-
Visual Studio anpassen und erweitern - in Paderborn
Mein Kollege Jens Schaller und ich sind am 2. April 2007 bei der .NET User Group Paderborn zu Besuch, wo wir ab 18:00 einen Vortrag mit dem Titel “Visual Studio anpassen und erweitern” halten werden.
Auf der Agenda stehen:
- Code Snippets
- Project und Item Templates
- Makros
- Add-ins
- Packages
Das ist natürlich eine Menge Stoff für einen Vortrag, deshalb werden wir flexibel auf die Interessenslage der anwesenden Zuhörer reagieren. Einen gewissen Schwerpunkt wird es beim Thema “Add-ins” geben, wo wir beide auf unsere Erfahrungen aus der Entwicklung unserer jeweiligen Hobbyprojekte SonicFileFinder (Jens) bzw. GhostDoc zurückgreifen können.
-
SonicFileFinder 1.8 Released
My colleague Jens Schaller has released a new version of SonicFileFinder, a free add-in for Visual Studio 2005. SonicFileFinder adds a fast search for files in the current solution, just by entering parts of the file name. This is definitely one of those tools I install on every development machine I work on.
The new version has a long list of additions and fixes, my personal highlights are (in no particular order):
- Opening the Windows Explorer for the selected file will now not only open the containing folder, it will also select the file.
- The feature “Search by Initials” now works with partial matches. For example typing the uppercase letters “PB” will find “PrefetchBuffer.cs” as in earlier versions, but also “PrefetchBufferManager.cs”, “PrefetchBufferException.cs” etc.
- Fixed support for multi-monitor systems (nice if you have multiple copies of Visual Studio opened on different monitors)
Jens has also added Vista compatibility for the installer – before anyone is asking: yes, I’ll add that to GhostDoc in the next minor release (no idea regarding a release date yet, I’m currently busy finishing an important part of another hobby project). In the meantime, there’s a workaround, see the GhostDoc website for more information.
Update 2007–02–23: Jens just put up a bugfix release (SonicFileFinder 1.8.1)
-
How to Delete an WinForms Control Event Handler Quickly
Recently a long-time user of Visual Studio looked over my shoulder when I deleted an event handler from my source code, and he said “uh, wait… how did you do that?”. If you are like him, not using the keyboard for this task, and would like to speed up things a bit, you may find this tip useful.
Imagine you have an event handler in a file MyForm.cs, e.g.
private void myButton_Click( object sender, EventArgs e )
{
// ... some code ...
}Deleting only this method obviously results in a compiler error as there’s a line
this.myButton.Click += new System.EventHandler( this.myButton_Click );
in the file MyForm.Designer.cs that has to be deleted as well.
To delete the event handler properly in Visual Studio 2005, using only the keyboard, perform the following steps:
- In the MyForm.cs file, move the cursor on the name of the method file (i.e.
myButton_Click
) and press Shift-F12 (commandEdit.FindAllReferences
), which will bring you to the Find Symbols Results window. - press the Cursor Down key to move to the second line showing the occurrence of myButton_Click in the designer-generated code that connects the event with the handler method*
- press Enter to jump to the MyForm.Designer.cs file
- delete the current line by pressing Ctrl-Shift-L (command
Edit.LineDelete
) - jump back to the MyForm.cs by pressing Ctrl-Tab
- and finally delete the code of the event handler method.
The description of the steps may sound a bit complicated at first, but you’ll find that the actual keystrokes come naturally pretty soon.
_____________
*) Note that this is only the case when the form was actually created in Visual Studio 2005 – keep your eyes open when working with forms in older projects that were started in Visual Studio .NET 200x. - In the MyForm.cs file, move the cursor on the name of the method file (i.e.
-
Thank You!
There’s a time for complaining about issues, and there’s a time for telling when things are great.
I’m right in the middle of writing custom column and cell types for a DataGridView and I had a problem with adding a custom column to an existing grid – the DataGridView threw an exception in design mode, obviously a bug in my new code.
It took me only a couple of minutes to
- start a second instance of Visual Studio for debugging*
- open the current solution a second time
- open the designer for the dialog the DataGridView was on
- add the custom column
- watch the first Visual Studio instance point me to the source code location where the resulting exception was thrown
- edit the code (after letting Visual Studio unwind the exception)
- and continue with a now working custom column.
Some of you out there may shrug their shoulders and ask “so what?”, but I must admit that even though I have used edit and continue for code running in Visual Studio before (when developing managed add-ins), I never cease to be freaking amazed! So to whoever contributed his/her part to making this work: Thank You!
_____________
*) Project Properties – Debug – Start Action – Start external program – enter the full path of devenv.exe -
Article "Introduction to GhostDoc" up on DotNetSlackers
Some time ago Sonu Kapoor, webmaster of dotnetslackers.com, asked me to write an article about my Visual Studio add-in GhostDoc. It took me some time to find an empty spot in my busy schedule, but the article is now finally online. It is an introduction to GhostDoc that may be interesting for those who haven’t tried GhostDoc yet and would like to read a bit more about the features before actually downloading and installing it.
-
SonicFileFinder 1.2 Released
Jens Schaller has released version 1.2 of his free Visual Studio add-in SonicFileFinder.
In a typical case of “less is more”, Jens has taken a hard look at how to specify the file filter and has reworked it completely, ripping out the different options (compare prefix vs. find text in name). They can now be expressed by using file wildcards (*, ?). In a situation where speed all that counts, it’s the fastest way to express what you are looking for. And the wildcards don’t get in your way; entering e.g. “SomeText” is equivalent to “*SomeText*”. Allowing file wildcards was actually my personal killer feature of the DPack File Browser that even made me consider to switch (at least for a moment), but seems like Jens has listened carefully when I talked about DPack at lunch time ;-)
Version 1.2 also offers better configuration of the GUI, allowing to switch off features that either take up screen real estate (e.g. the “Match” column) or you simply don’t want to see.
For full details, see this post on Jens Schaller’s blog.