Wednesday, February 13, 2008

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...

6 comments:

Sean said...

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).

Thomas pedro said...

The lodging business sector is perhaps the best case we have today of how free market activity drives markets. Yes, much less demanding than the gadget that your educator initially used to clarify the guideline back in secondary school. To help us make a practical future viewpoint, we should first visit the past. car title loans

Thomas pedro said...

You can purchase an auto today and pay for it in portions over a three year time span; the same for the house. Get it, move in, and advantage from living in your own home, and pay as you go over a time of 30 or 15 years. payday loans

marko said...

In spite of the fact that the possibility of having such a large number of various options can be on the double, both overpowering and energizing, knowing the home advance nuts and bolts for the ones that suit your motivation and necessities can help you make mage investment funds over the long haul. payday loans

marko said...

The financing cost brought in secured home credits is lower than whatever other advances. Since the loan specialist's cash is secured against the property, he has less hazard and stands to give low financing costs. Low loan cost decreases the weight of reimbursement from your shoulder. Payday Loans San-diego

marko said...

It is critical to note that having terrible credit in the past does not manage your future. You have to settle on a decision to pay your bills on time going ahead. It is significantly more troublesome for a bank to furnish you with a home advance for awful credit in the event that you keep on paying your obligations late. Cash Advance Corona