The opinions expressed in these materials are my own and are not necessarily those of Microsoft.
Copyright © Microsoft Corporation. All rights reserved. Unless otherwise indicated, all source code provided is licensed under the Microsoft Public License (Ms-PL).
Sara Ford (http://saraford.net) and I had a long talk the other day and are considering a revision to the Coding Faster book (possibly even a title change). Here are some basic thoughts we are pretty sure we want in the update (if we decide to do it):
So these are some of the things we discussed. If you have an opinion post it here or email me at firstname.lastname@example.org
I get tons of questions from customers on when support will end for a variety of products. I frequently refer them to the MS Support Lifecycle Homepage so thought I would share. If you are not familiar with it the home page allows you to ask questions and get information on when product support will end. For example, I looked up the lifecycle information on the .NET Framework versions by going to the products listed by family.
Then selecting .NET Framework in the Developer Tools area:
Which resulted in a table laying out all the details for .NET Framework support lifecycle (click on image to go to the table):
Rinse and repeat for the product you are interested in
In case you haven’t heard Jason just announced the new RC is available:
You can download the bits here:
I’m on the road right now but more details to follow soon
Now that I’m published the marketing folks send me all kinds of stuff on book specials. Most of them are cheezy but this one looks pretty cool so thought I would share. Here is the tweet they are sending out:
CyberMonday Deal: Save 60% on 60 new and top ebooks! Today only. Shop now: http://bit.ly/s3vkkJ
Naturally the book I did with Sara is on there for like 12 bucks or something as well as many other titles. Good times
SKU: Premium, Ultimate
In vstipTool139 (“Static Code Analysis – Simple Code Analysis”) we scratched the surface of code analysis for a simple class. Now we will begin to delve deeper into the extensive set of predefined rules available out-of-the-box in Visual Studio. In these examples I will be using Visual Studio 2010 however most of the rules exist in Visual Studio 2008 as well. To see the list of the differences in rules read this article from the Code Analysis Team blog:
The biggest difference between Visual Studio 2008 and 2010 is the creation and management of rule sets which is why I have the version set to 2010 only. The new way to manage rules makes it very easy to work with existing rules in a multitude of ways. Also, I am limiting myself to managed code rules for these examples but the same techniques apply to unmanaged code rules as well. Without further ado, let’s explore some of the ways we can work with predefined rules.
First, create a new class library project in C# or VB then go to the project properties. Click on the Code Analysis tab inside the project properties. You should see the following:
The first choice you are faced with is which set of predefined rules to use. By default the Microsoft Minimum Recommended Rules will be applied however if you click on the dropdown list for the rule sets you will see many more options to choose from:
This table lays out the names and general purpose of each of the available managed predefined rule sets:
Microsoft All Rules
This rule set contains all rules. If you run this rule set, a large number of warnings might be reported. Use this rule set to get a comprehensive picture of all issues in your code. This approach can help you decide which of the more focused rule sets are most appropriate to run for your projects.
Microsoft Basic Correctness Rules
These rules focus on logic errors and common mistakes made in the usage of framework APIs. Include this rule set to expand on the list of warnings that the minimum recommended rules report.
Microsoft Basic Design Guideline Rules
These rules focus on enforcing best practices to make your code easy to understand and use. Include this rule set if your project includes library code or if you want to enforce best practices for easily maintainable code.
Microsoft Extended Correctness Rules
These rules expand on the basic correctness rules to maximize the number of logic and framework usage errors that are reported. These rules emphasize specific scenarios such as COM interoperability and mobile applications. Consider including this rule set if one of these scenarios applies to your project or to find additional problems in your project.
Microsoft Extended Design Guideline Rules
These rules expand on the basic design guideline rules to maximize the number of usability and maintainability issues that are reported. These rules emphasize naming guidelines. Consider including this rule set if your project includes library code or if you want to enforce the highest standards for writing maintainable code.
Microsoft Globalization Rules
These rules focus on problems that prevent data in your application from appearing correctly in different languages, locales, and cultures. Include this rule set if your application is localized, globalized or both.
Microsoft Minimum Recommended Rules
These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. You should include this rule set in any custom rule set that you create for your projects.
Microsoft Security Rules
This rule set contains all Microsoft security rules. Include this rule set to maximize the number of potential security issues that are reported.
Note: You can find this table in the documentation at http://msdn.microsoft.com/en-us/library/dd264925(VS.100).aspx
At a high level the rules deal with correctness, design, globalization, and security issues. Since we are creating a class library it might make sense for us to use the design guidelines based on the description. Pick the Microsoft Extended Design Guideline Rules for our project then click the Open button so we can explore the details:
NOTE: Keep one thing in mind as you explore these rules: there is no “one size fits all” solution. Your final rule set will almost always consist of several other rules that you feel are best for your needs.
We’ll get to the inner workings of this editor in a later post but, for now, focus on the ID column. Take note of the various categories we can expand to get details. Below is a list of these categories and what they represent:
Warnings that support correct library design as specified by the .NET Framework Design Guidelines.
Warnings that support world-ready libraries and applications.
Warnings that support interaction with COM clients.
Warnings that support library and application maintenance.
Warnings that support efficient power usage.
Warnings that support adherence to the naming conventions of the .NET Framework Design Guidelines.
Warnings that support high-performance libraries and applications.
Warnings that support portability across different platforms.
Warnings that support library and application reliability, such as correct memory and thread usage.
Warnings that support safer libraries and applications.
Warnings that support appropriate usage of the .NET Framework.
Note: You can find this table in the documentation at http://msdn.microsoft.com/en-us/library/ee1hzekz.aspx
The number of rules you deal with in each category depends on the rule set you have chosen. For example, the extended design rule set has about 60 design rules, 2 globalization rules, and 7 interoperability rules among the other rules in this set:
By now you have no doubt noticed the warning just below the toolbar in this editor. You are just exploring the rules for now but when we modify the rules in a later tip you will have to save your changes to a new rule set file. Don’t be intimidated by rule set files, they are just XML files. Here is a piece of the extended design rule set in Notepad:
Back in our rule set editor, expand the Microsoft.Design category and select rule CA1044:
The first time you select a rule, you will be presented with this choice at the bottom of the rule set editor:
I suggest leaving the default settings and then click the OK button. When you do, you will then see the help entry for the rule you are currently looking at:
At this point we have gone from understanding the basic function of the predefined rule sets to understanding the categories of the rules in a set to understanding individual rules. From here you can explore the different rule sets and each of the rules in those sets to determine what rules may be interesting to you going forward. We will learn more about navigating these rule sets in the next tip.
At long last it is with great pride that I can officially announce the availability our new book! After a year of work and a few interesting speed bumps along the way the book is now in stores world-wide. If you want the best price that I have seen so far, I suggest you go to Amazon:
If you get a copy of the book, Sara and I would love to hear what you think about it and any improvements you would like to see in the next revision. You can email me at email@example.com with your comments / suggestions / etc.. Also, if you get a chance, please make sure to give a review on Amazon and/or the O’Reilly web site so others will know if they should buy the book or not.
For those who aren’t regular readers of this blog, here is the basic information from the main O’Reilly book site:
Take a detailed look into Visual Studio—and learn practical techniques to help you work more efficiently. This fully revised and expanded version of Visual Studio Tips: 251 Ways to Improve Your Productivity includes a comprehensive collection of tips and shortcuts for working with the code editor, visual designers, searches, debugger, and other features in Visual Studio 2005, 2008, and 2010.
Expert advice to help you work smarter and increase your productivity with Visual Studio.
Take a detailed look into Visual Studio—and learn practical techniques to help you work more efficiently. This fully revised and expanded version of Visual Studio Tips: 251 Ways to Improve Your Productivity includes a comprehensive collection of tips and shortcuts for working with the code editor, visual designers, searches, debugger, and other features in Visual Studio 2005, 2008, and 2010. You'll gain valuable insights for using this IDE—no matter what your experience level.
Discover how to:
I thought it would be appropriate to list the acknowledgements for the book here again to thank those who had an impact on our lives and on the book:
Jane and Louie Smolensky / Beulah Bourgeois / Annabelle Fayard / Helen Naboulsi / Russell Chandler—Our immediate friends and family.
Russell Jones and Adam Zaremba—Editors at O’Reilly Media, who herded the cats to make this book happen.
Kevin Stevens—Who came up with the name of the book and was instrumental in the technical review process.
Paul Millsaps and Bill Needels—For doing some of the technical review for the book.
Sean Laberee—Senior Program Manager Lead at Microsoft who helped both Sara and me get started with Tips and Tricks.
Dustin Campbell—Program Manager at Microsoft who continues to be a constant source of information when I get stuck on a feature or concept.
Brittany Behrens—Program Manager at Microsoft who helped me during those first tenuous days after I took over Sara’s work.
Matt Manela—for writing the content for the Snippet Designer extension.
Andrew Steele—for writing the content for the Productivity Power Tools extension.
Jim Christopher—for writing the content for both the GhostDoc and the StudioShell extensions.
Terry Leeper—Principal Architect, Windows C++ Team, my main contact with the C++ folks and a good friend that has helped me resolve questions about features since I started doing the tips.
Lisa Feigenbaum and Beth Massi—Program Managers at Microsoft who constantly provided guidance and support as the content of the book evolved.
Brian Moore—Director, DPE Central Region, for providing support and being a great manager.
Clint Edmonson—Senior Architect Evangelist at Microsoft who I have toured with throughout the country delivering Visual Studio talks to thousands of people.
Phil Wheat—My best friend at Microsoft and a constant source of information. Phil is easily the smartest person I know.
Jared Bienz, Mike Azocar—Very good friends who have been great to bounce ideas around as I worked on the book.
Rob Bagby, Mike Benkovich, John Weston, Keith Combs—My old Microsoft Across America buddies.
Finally, Sara Ford wishes to thank Dr. Terrance Delaney and Dr. Michael McMurray for fixing her chronic shin splints during the course of writing this book.
Windows: CTRL + Double Click on Title Bar Menu: Window | Dock As Tabbed Document Command: Window.DockAsTabbedDocument
SKU: Professional, Premium, Ultimate Versions: 2010, Visual Studio 11 Developer Preview Code: vstipEnv0065
In Visual Studio 2010 we introduced the ability to take document windows outside the IDE:
However, the old trick of double-clicking on the Title Bar to dock the window back into the tab well doesn’t work anymore. It turns out that CTRL + Double-Click is the new shortcut to dock document windows back into the IDE:
If you have installed the Productivity Power Tools (http://visualstudiogallery.msdn.microsoft.com/d0d33361-18e2-46c0-8ff2-4adea1e34fef) or have Visual Studio 11 Developer Preview then you have floating tab wells:
You can CTRL + Double-Click on the window’s Title Bar to dock all the tabs in the external tab well.
The strange part comes when you have multiple tabs in an external tab well. If CTRL + Double-Click on an individual tab in the external tab well when there is more than one tab it creates a new tab well with only one tab in it. When you CTRL + Double-Click on a tab that is the only one in the current tab well then it will dock it. Not sure if this is intentional behavior or a bug.
My friend, Jon Box, asked me to let all the country music fans out there know about this great contest that is going on for the Country Music Awards. Here is what he has to say about it:
Rascal Flatts, Jason Aldean, and Ronnie Dunn have different prize packages just waiting for you. Go to these links and follow the registration instructions. You’ll need IE9 and Windows 7, and the contest payoff could be big for the country music fan. Each artist has their own contest and they have different COOL prizes. They do each offer CMA Music Fest 4 Day passes, which makes this WAY COOL!!!
And 4 nights at LP Field plus these other prizes, it’s a country music fan’s dream event. If you don’t know, CMA Music Fest is like no other music event. During the day, you can visit Fan Fair Hall to meet artists, as well as see artists perform at music stages around downtown Nashville (just check out the Riverfront Park schedule – awesome by itself). Then at night, we head to LP Field and see some of the hottest names in country music (6 mini-concerts each night on the schedule). And as the CMA Music Fest veterans know, 4 day pass holders get special benefits at LP Field like STAGE-FRONT access in the Fan Photo Line. Nothing like a stroll right in front of a big act blowing out the stadium.
These contests will be done through an IE9 feature called “site pinning”. The instructions on the contest links will tell you exactly what to do to get started. But, basically, after providing your Facebook login, there will be an image to drag to your taskbar (this is the pinning), which will put a button from your artist on your taskbar. And then daily right click, and select “Enter Pin To Win Contest”.
So if you are a country music fan here is your chance to attend the CMA Music Fest
I just got an update on the expected date for the book and thought I would let you all know. Right now it appears that, due to all the formatting that needs to be done, the date for release is late July / early August. I went a few rounds with the editors to get this date pushed earlier but they convinced me there is no way to get the book out sooner without sacrificing the quality of the work. I know many of you are waiting for the release and I, too, am just waiting to get it out there so we can get this into people’s hands.
For those on Facebook, I’ve created a page for the new book that I will post info and polls, etc… on:
On a semi-related note, now that the book is completed, I’ll be taking the month of June and early July off to recharge. I’ll pick back up again in mid July and hit the ground running with more tips and information on the new book (of course). If any breaking news comes up between now and then I’ll post it and I will most likely post other miscellaneous things as well concerning conferences, contests, etc… that are coming up just so the blog isn’t completely dark during my time off.
Folks I just wanted to call it out since the book doesn’t really emphasize it as much as I would like. The appendix is basically a second book that goes with the first. I took the entire body of work and divided it into part that go to print and parts that get put in the appendix area. If you only read the book you are only getting half the content so make sure you do the following: