Visual Studio Hacks
Jim Holmes writes "Microsoft's Visual Studio is an elephant of an IDE. It's got tremendous power and adaptability, but it's difficult to dig through all the less-than-helpful documentation. It's also very tough to figure out which of the many available add-on tools are worthwhile to add. Visual Studio Hacks by James Avery is a terrific reference for helping get the most out of Visual Studio." Read on for the rest of Holmes' review.
Visual Studio Hacks
author
James Avery
pages
512
publisher
O'Reilly
rating
Outstanding
reviewer
Jim Holmes
ISBN
0596008473
summary
Get the most out of Microsoft's Visual Studio
Disclaimer: James is a friend who's helped me with starting a developers group, and I'm also working on an open source project with him. The possibility exists that I may work on a paying project with him at some time in the future; however, I haven't had any financial dealings with him so far. (Other than I still owe him a beer for coming to speak at one of our group's meetings.) For what it's worth, I spent my own money to buy this book from Amazon. End Disclaimer.
Avery's book is great both for new users of Visual Studio as well as the more experienced developer. Also, readers won't have to worry about buying a book which will be outdated when Microsoft releases its next version of Visual Studio in November. Tips and tricks are included for Visual Studio versions 2002, 2003, and 2005.
VS Hacks spreads 100 "hacks" across 13 sensibly delineated chapters. Each hack is clearly marked with its number in a blue box at the upper, outer corner of each page. Hacks are also marked with a thermometer icon representing the hack's relative complexity. One of my few complaints about the book is that the moderate and expert icons look too similar - but frankly I ignore these icons anyway, so the criticism's most likely wasted.
The introductory chapters on projects and solutions, navigation, and editor usage aren't introductory in skill level. Avery covers these topics in great depth, diving down to some useful, but less-than-obvious settings in VS's environment. Examples of this would include Hack #2: Master Assembly and Project References, where Avery shows how to add additional assemblies to the Add Reference dialog's list of .NET assemblies. This is a timesaver if you've got custom libraries you make frequent use of; adding the assemblies to the default list saves having to use the Browse button to search for the files every time you need to add them.
Some of the most uninteresting drudgework in development involves writing code for basic software elements such as business entities or data access layers. It's repetitive, it's template-like material, and it's boring. Documenting such work is every bit as tedious.
Hack #50 covers using CodeSmith to generate code via templates. Other hacks detail tying UML into the development process. Hack #81 covers using Visio for Enterprise Architects to generate code from UML diagrams. Hack #82 covers the opposite of that process: generating class diagrams via Visio's reverse engineering support. (UML's capable of much, much more than the simple drudgework of business entities or data access layers, and these hacks shouldn't be confused with anything more than a cursory introduction of how to tie UML via Visio into Visual Studio.)
One of the most useful sections is Chapter 5: "Debugging." This chapter focuses on getting the most out of Visual Studio's debugger capabilities. These hacks are critical helpers to good developers effectively use Visual Studio's debugger.
Avery covers the basics of setting up breakpoints, diving down to various options such as setting how often to break on specific break points, or setting conditional break points. He then moves on to troubleshooting breakpoints in Hack #37, and there's also great coverage on using Visual Studio to debug scripting code inside a browser session, working with SQL server, and attaching to a running process or one that's just about to crash.
I found the best content of this book in hacks focusing on making the most of tools both inside and out of Visual Studio. Hack #79 is a great section detailing how to stress test web applications using Visual Studio Enterprise Architect's Application Center Test. This hack makes it easy for readers to understand how to get detailed stress testing on a web application. Along this same line, Hack #80 shows how to make use of the Dotfuscator tool to obfuscate .NET assemblies to protect them from modest efforts at reverse engineering. (Like Java, .NET assemblies can be disassembled, revealing all your hard work and intellectual property.)
Other gems in this same arena include tools for running and debugging unit tests inside Visual Studio (#93), testing regular expressions (#100), and using tools which automatically generate documentation based on naming conventions in the source code (#69).
The mechanics of this book are great. The Table of Contents breaks down each chapter by its individual hacks, and the index is very detailed and clear. I also like how hacks are listed on the top of each page, making it quick to find something if you know the hack's number or name and don't want to fuss with the table of contents.
My sole complaint about the book (aside from the annoying thermometer icons I've already mentioned) is that it's not always clear which add on tools work with which version of Visual Studio.
The author maintains a website specifically for this book, complete with code and tool downloads. RSS feeds are also available to monitor any updates the author makes.
This book is a critical addition to the bookshelf for any developer who spends any amount of time working in Visual Studio. You'll become much more productive by using tips in the book, and you'll find tips to help you decide which add-on tools you'll want to make use of. More importantly, you'll understand how to get the most out of Visual Studio's capabilities.
You can purchase Visual Studio Hacks from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Disclaimer: James is a friend who's helped me with starting a developers group, and I'm also working on an open source project with him. The possibility exists that I may work on a paying project with him at some time in the future; however, I haven't had any financial dealings with him so far. (Other than I still owe him a beer for coming to speak at one of our group's meetings.) For what it's worth, I spent my own money to buy this book from Amazon. End Disclaimer.
Avery's book is great both for new users of Visual Studio as well as the more experienced developer. Also, readers won't have to worry about buying a book which will be outdated when Microsoft releases its next version of Visual Studio in November. Tips and tricks are included for Visual Studio versions 2002, 2003, and 2005.
VS Hacks spreads 100 "hacks" across 13 sensibly delineated chapters. Each hack is clearly marked with its number in a blue box at the upper, outer corner of each page. Hacks are also marked with a thermometer icon representing the hack's relative complexity. One of my few complaints about the book is that the moderate and expert icons look too similar - but frankly I ignore these icons anyway, so the criticism's most likely wasted.
The introductory chapters on projects and solutions, navigation, and editor usage aren't introductory in skill level. Avery covers these topics in great depth, diving down to some useful, but less-than-obvious settings in VS's environment. Examples of this would include Hack #2: Master Assembly and Project References, where Avery shows how to add additional assemblies to the Add Reference dialog's list of .NET assemblies. This is a timesaver if you've got custom libraries you make frequent use of; adding the assemblies to the default list saves having to use the Browse button to search for the files every time you need to add them.
Some of the most uninteresting drudgework in development involves writing code for basic software elements such as business entities or data access layers. It's repetitive, it's template-like material, and it's boring. Documenting such work is every bit as tedious.
Hack #50 covers using CodeSmith to generate code via templates. Other hacks detail tying UML into the development process. Hack #81 covers using Visio for Enterprise Architects to generate code from UML diagrams. Hack #82 covers the opposite of that process: generating class diagrams via Visio's reverse engineering support. (UML's capable of much, much more than the simple drudgework of business entities or data access layers, and these hacks shouldn't be confused with anything more than a cursory introduction of how to tie UML via Visio into Visual Studio.)
One of the most useful sections is Chapter 5: "Debugging." This chapter focuses on getting the most out of Visual Studio's debugger capabilities. These hacks are critical helpers to good developers effectively use Visual Studio's debugger.
Avery covers the basics of setting up breakpoints, diving down to various options such as setting how often to break on specific break points, or setting conditional break points. He then moves on to troubleshooting breakpoints in Hack #37, and there's also great coverage on using Visual Studio to debug scripting code inside a browser session, working with SQL server, and attaching to a running process or one that's just about to crash.
I found the best content of this book in hacks focusing on making the most of tools both inside and out of Visual Studio. Hack #79 is a great section detailing how to stress test web applications using Visual Studio Enterprise Architect's Application Center Test. This hack makes it easy for readers to understand how to get detailed stress testing on a web application. Along this same line, Hack #80 shows how to make use of the Dotfuscator tool to obfuscate .NET assemblies to protect them from modest efforts at reverse engineering. (Like Java, .NET assemblies can be disassembled, revealing all your hard work and intellectual property.)
Other gems in this same arena include tools for running and debugging unit tests inside Visual Studio (#93), testing regular expressions (#100), and using tools which automatically generate documentation based on naming conventions in the source code (#69).
The mechanics of this book are great. The Table of Contents breaks down each chapter by its individual hacks, and the index is very detailed and clear. I also like how hacks are listed on the top of each page, making it quick to find something if you know the hack's number or name and don't want to fuss with the table of contents.
My sole complaint about the book (aside from the annoying thermometer icons I've already mentioned) is that it's not always clear which add on tools work with which version of Visual Studio.
The author maintains a website specifically for this book, complete with code and tool downloads. RSS feeds are also available to monitor any updates the author makes.
This book is a critical addition to the bookshelf for any developer who spends any amount of time working in Visual Studio. You'll become much more productive by using tips in the book, and you'll find tips to help you decide which add-on tools you'll want to make use of. More importantly, you'll understand how to get the most out of Visual Studio's capabilities.
You can purchase Visual Studio Hacks from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Yes, I know a lot of Visual Studio hacks. Some say it's coders like them that are the problem with software today...
"Who are in control, they are not in control of anything - they don't even control themselves!" - Glen Beck
although it does mention most of these hacks won't work when the new Visual Studio comes out.
But informative none the less.
-- Tigger warning: This post may contain tiggers! --
Is it just me or is a "hacking" culture growing out of the internet? People are getting fed up with the limitations put on them by business' slowness, so they push the limits of current technology to meet their needs.
Is this because people's needs are growing faster than industry's ability to provide them?
MS Visual Studio is Microsoft's ultimate killer app. It's just the single best tool for software development. I use it even when developing for Linux.
Until Linux gets an IDE at least 75% as good as MSDev, top-notch large scale applications for Linux will remain few and far between.
Test 1 2 3 4
Anyone got one?
I highly recommend
.NET
Best Kept Secrets in
by Deborah Kurata
This has plenty of good tricks for visual studio:
Chapter 1 - Hidden Treasures in Visual Studio
Chapter 2 - Doing Windows Forms
Chapter 3 - Code Tricks
Chapter 4 - Much ADO
Chapter 5 - Defensive Development
Have you Meta Moderated t
I tend to work on code in Visual Studio 6 at least once a month that still works just fine here, ~10 years after its release.
.NET for example were based on EMCA standards, standards which have been implemented for use under Linux, MacOS and others, all making it possible for you to build an application in VS2003 and have it run on other systems.
But even when it comes to VS2003, last time I checked C# and
Help Brendan pay off his student loans
Four letters. MSDN. Now show me something comparable in the OS world.
Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
What truth?
There is no dupe
Even with this annoyance it's still better than help in XCode on the Mac. XCode 2.x is a big improvement but it's still hopeless compared to MSDE.
A second annoyance to DevStudio is the sheer mess of dockable windows. VC98 had it just about under control but since DevStudio 2002 it has become a disaster zone of tabs, splitters, pushpins, floaters and toolbars. Just trying to get all the relevant information onto the screen is hard enough. The pushpin model just works badly - either you pin a window to a frame or it annoys you by floating in and out at just the wrong point in time such as when you're mousing around.
A final irritation is that DevStudio is extremely primitive compared to a lot of Java suites. Eclipse is hopeless for visual design but it kicks DevStudio around the shop for sheer coding. Being able to hit Shift+Ctrl+R and rename all references to a class or variable everywhere in Eclipse is mindbogglingly useful. While I expect the next incarnation of DevStudio will allow you to rename a class, it's notable by its absence in the current releases. It's not like Eclipse just introduced this feature since JBuilder has had it for years.
Erm... We write highly portable libraries in C and C++ at work. They have to compile on Windows, Linux, Solaris, HP-UX, AIX, MacOS X, and often under several different toolsets on each OS.
Our whole dev team is free to develop using whatever software we find helpful. We have GUI guys and CLI guys, Windows guys and Linux guys, emacs guys and vi guys, etc.
The one thing almost everyone has in common is that they use Visual C++ as their primary IDE. That's not because we're ill-informed or haven't tried the alternatives, it's because most of us think it's the best IDE available to help us do our jobs.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
A book on Visual Studio hacks has a lot going for it, but the examples in the review mostly sound like discussion of add-in tools, rather than VS itself.
Many people don't take advantage of even simple things like customising autoexp.dat for debugging, and don't know about undocumented UI tweaks like displaying a marker line at column N. Many of these little touches are what makes VS better than the alternatives for a lot of jobs, and why Microsoft never makes more of them I don't understand. Are things like the two examples above covered in the book?
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
I remember when I programmed in Visual Studio there was a good add on called Visual Assist, the company is Whole Tomato I used like 3 years ago and it was quite nice, it adds some features to the IDE that make coding easier.
Ubuntu is an African word meaning 'I can't configure Debian'
You misspelled emacs
Only on /. would someone be dumb enough to cite sourceforge as a good example of a fully integrated help/documentation/examples/technical discussion/articles/books/advise system. Sourceforge is many things but if you look at 95% of the projects on it they have nothing whatsoever to do with quality code or documentation.
Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
What truth?
There is no dupe
So I normally prefer to use emacs as my IDE, especially for anything complex, but for those times when I need to use Visual Studio I've been getting a little bored with the standard tools so hacked together an add-in (not just the tools or macros, but the proper add-in mechanism) framework entirely in perl... suddenly I can knock up simple reg-exp based editor tools and I don't need to descend to some crappy VB/C# level coding to do so...
But has anyone noticed what a complete mess the Visual Studio add-in API is ? A hybrid mixture of DLL export functions and nearly-COM like objects... very 1993... I think it must count as the biggest hack in Visual Studio.
I spent a lot of money on booze, birds and fast cars. The rest I just squandered. - George Best
If Visual Studio isn't your bag, but you still like Visual C++, then grab the Visual C++ 2003 toolkit (just the compiler, free) and stick Code::Blocks on top of it.
[o]_O
This is more in-depth than you might expect:6 003609/
http://www.amazon.com/exec/obidos/tg/detail/-/059
--- These are not words: wierd, genious, rediculous
WTF are you talking about? have you even *LOOKED* at the msdn documentation? hell, just the .Net sdk docs are more consistant, and organized than *ANY* api docs for any other platform I've seen.
Michael J. Ryan - tracker1.info
You can download an add-in to provide scroll wheel functionality in VS6.
1 0
http://support.microsoft.com/Default.aspx?id=8379
Open the .dsp file. Near the top you will find something like:
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
Change "cl.exe" to your favorite C++ compiler.
Who the hell told you that?
I've done my time at MS and that statement is completely false. While different people have different preferences (even at MS), VS is still the IDE of choice for most of us. At least when we're writing code for MS-based operating environments.
http://www.vbrad.com/Reviews/books/brVisualStudioH acks.htm
I've been on a few teams here at MS, and I must say that the source isn't that hard to get too. Now getting WRITE permissions too it is a pain, but right now I can see all the source to SQL, most of the source to the CLR and VS, some of office, some Windows, and I'm sure anything else could be gotten by just asking. (if it exists... I was looking for diamond.exe source a couple weeks ago to fix an AV we keep getting and apparently no one has compiled that thing since '96 and we couldn't find it.)
In a word, yes.
.NET can be customized as well. Better yet, you coiuld write a plugin app that would take advantage of all the settings and translate them to their gcc equivalents.
I did something similar for Visula Studio 6 when I was working on a project for a couple of embedded platforms.
VS
It just depends on how much time you want to take.
~X~
~X~
I've used Studio 2003 new for the last year and a half. Overall I like it alot and wish I had a linux equivilent (monodevelop has SOOOOOOOO far to go). The only thing I hate hate hate hate (x1000) is it's lousy integration with source safe when it comes to ASP.net projects. Ever try moving a web project from one location to another? Or try to get a un-source controlled copy of your project. Good luck, it's possible but excruciatingly painful.
Just my $1 and 2 cents.
Blender And Linux Fan
Resharper.
It adds real-time syntax highlighting, additional keyword coloring, superb code navigation features, and code refactoring features, among many other very useful items.
If you are using Visual Studio and doing any C# coding at all, you need to check out Resharper, from JetBrains... http://www.jetbrains.com/resharper/. I frankly don't know how anyone lives without it (or at least something similar).
Version 2.0 (due out late this year) will also support 2005, Visual Basic, and ASP.Net coding
- Spryguy
There are three kinds of people in this world: those that can count and those that can't
Javac is written in java, so compiling anything requires firing up a jvm first, which can take a while.
However, since Eclipse is written in java, the jvm is already running, so it can just call up the appropriate javac classes and run the compiler in-process, removing the latency of starting up a new jvm. That's most likely why Eclipse is much more snappy at compiles (off the top of my head; I haven't written any Java in a while).
Alternatively they could be using IBM's jikes compiler, which is written in C or C++, so it also doesn't have the startup requirement of loading a jvm.
I've come for the woman, and your head.
Tightly integrated that is with SQL Server for example. Need to debug a stored procedure? Set a break point in it using VS and step through it, adding watches and such like if you were debugging C# code for example. Now that is the shiztnizz.
Oh how I wish my company would upgrade both VS and SQL Server, guess I'm stuck with VS 2003 for a while. Sigh... ;)
For this issue, you can use Whole Tomato's Visual AssistX. It works on every version of VS that MS released. Link: http://www.wholetomato.com/
Agreed, it's great.
But if you're working on more than one project at a time, the "load time" is very annoying. (It seems to build a big cache of methods, etc., when it loads)
> Version 2.0 (due out late this year) will also support 2005, Visual Basic, and ASP.Net coding
What do you mean by "will support ASP.NET"? That's what I use it for already.
.
They will never know the simple pleasure of a monkey knife fight
I shake my head and marvel...poor, closed-minded souls who se nothing but an MS product and think they are on the top of the world for ridiculing it.
...
:). And when I decide to write an application that will only ever run on Windows...or in a web browser...or in mono...I realized that it would actually take a little work to learn a new IDE. I asked myself if I was man or mouse.
*sigh* The trolls do rush to these threads. Meanwhile we who actually try things before denigrating them have found an extremely capable IDE, enjoying the capability to code in/edit Ada, APL, ASml, Caml, Cobol, Delphi, Forth, Eiffel, Fortran, Haskell, Lisp, Lua, Mercury, Mixal, ML, Mondrian, Nemerle, Oberon, Pascal, Perl, PHP, Prolog, Python, RPG, Ruby, Scheme, Smalltalk, C#, C++, J#, VB.Net, XML, HTML, ASP, ASP.Net,
And what do people say to this? Dismiss it all with a handwave - MS Bah! - and stick to their advanced text editors because they know it. And it's easier.
Well, no arguments there! But I chose not to stck to any one language or editor. Knowing only one editor and having only one toolset was fine on the Commodore Vic-20, and unfortunatly Emacs was never as good as vi
I picked man. I decided to take the brave step and actually learn how to use something beyond a text editor. To learn how to make the editor fill my needs instead of assuming it would limit me to only a small subset of projects. After all, I reasoned, if my sole criteria were "easy to use" and "I already know it", then by the same logic I should have never learned how to use even the best text editor (vi).
Anyway, it's no skin off my nose. So go on, Anti-Microsoft serfs, enjoy your little bag of tricks for your script typewriter! Have your fun. Nobody said that we all had to be professionals! And at least you have one thing to brag about - you didn't bother to expand your skillset because it was MS! And continue to dream those fond dreams of catching Virii in the wild, of creating single script solutions to strip them out of messages, of your own advantages over virus writers who clearly can't know more than VB. An example does not define a set, which is why professionals try to understand what they are talking about before they open their mouths.
Whee signature.