How to Avoid Embarrassing Build Errors
It happens to all of us at some point. We pull up the command window, type "build test" and before you know your knee deep in compilation errors. To make a situation worse your pairing partner has lost all faith in your coding abilities. Your partner no longer wants to work with and you are convinced that the other developers are laughing at you behind your back. Well don't fret, thankfully the good folks at JetBrains have a new feature in ReSharper 3.1 called Solution Wide Analysis. Solution Wide Analysis will help you avoid those embarrassing build errors by catching them before you even compile.
Honestly, you are losing productivity if you don't turn this feature on. By default solution wide analysis is turned off. To turn on solution wide analysis follow these steps:
1. With the Keyboard: Alt + R, O
From here I recommend using the mouse since JetBrains seemingly forgot to add keyboard support. If you are listening JetBrains please add keyboard support to your options screen. It's some what silly that a product with so many keyboard shortcuts doesn't even have proper keyboard shortcuts in their own options screen. It's almost like the options screen was developed by a different development team or something. Anyhow back to the steps.
2. In the tree view under the code inspection heading click solution wide analysis.
3. Check the checkbox that says "Analyze errors in whole solution" I would have wrote "Analyze Errors" or "Analyze Errors in the whole solution". Now that I have found a grammar mistake please feel free to tear apart my blog posts.
4. Finally click the ok button and ReSharper will start to analyze your code.
If you look at the very bottom right corner you will notice a round icon. This round icon will display as green when the solution has no errors and red when there are errors. Double clicking on the icon will bring up a window that lists all errors. As an added bonus us keyboard junkies can simple press Alt + F12 to jump from error to error. If you would like to jump to a previous error just press Shift+Alt+F12. If you just want to jump to errors on the current page you can press F12.
This feature really comes in handy when you forget to implement a new method or property on an interface. I find that this typically happens when I mock out an object with Rhino Mocks. Everything appears to be fine with the test however a quick glance to the right corner of visual studio tells me immediately that there is an error. From there I just give it the old Alt + F12 and correct the error. Once the icon is green I know that I can build my solution without embarrassment.
What are you doing.... Go turn on this feature... Now... No excuses...
1 comments:
I love that feature a lot. Found an issue with resources and aspx files in asp.net - but you can just ignore those files (exclude).
Post a Comment