Articles

When rockin' out the NAnt build process, I thought it was necessary to have a folder that accurately states the build version/number of the enclosed assembly. I'm sure I could have done this w/code, but eff that... I wanted to have a bit of fun, trying the <code> tags from within the build file itself.
Given a path to an assembly, ${build.dir} will echo something like:
build-38372-383748--2010-10-10
I've found it handy for:
- Doing something at build time wo/another console app.
- Keeping track of builds (duh)
- Impressing the ladies.
(Sorry about the whacked formatting!)
<property name="build.dir" value="build" />
<property name="pathToAssembly" value="C:\your\moms\house\nice.dll" />
<target name="getbuildnum">
<script language="C#" prefix="method" >
<imports>
<import namespace="System.Reflection" />
</imports>
<code>
<![CDATA[
[Function("get-version-from-assembly")]
public string GetVersionFromAssembly(string assPath) {
Assembly ass = Assembly.LoadFrom(assPath);
return "build-"+ass.GetName().Version.ToString()
.Replace(".","-")+"--"+DateTime.Now.ToString("yyyy-MM-dd");
}
]]>
</code>
</script>
<property name='build.dir' value='${method::get-version-from-assembly(pathToAssembly)}' />
<echo message='${build.dir}' />
</target>

So just a quickie post. NAnt doesn't play very nicely with the MSBuild task especially with .NET 3.5, so I thought I'd post a snippet from a build file that I think I finally like (and works!).
* project has been renamed [to csharptocsharp] to protect the innocent lame!
<property name="msbuild" value="C:/WINDOWS/Microsoft.NET/Framework/v3.5/MSBuild.exe" />
<target name="compile" description="Compiles using the AutomatedDebug Configuration">
<!-- NAnt doesn't like this part! :( -->
<!--<msbuild project="src\csharptocsharp.com.sln">
<property name="Configuration" value="AutomatedDebug" />
</msbuild>-->
<!-- So we just use an exec task instead!-->
<exec program="${msbuild}">
<arg value="src\csharptocsharp.com.sln" />
<arg value="/v:n" />
<arg value="/p:Configuration=AutomatedDebug" />
<arg value="/p:WarningLevel=0" />
</exec>
</target>

This isn't really new, I know, I know I've heard it all before about ReSharper. "ReSharper is ok but...," or "It's expensive..." or "Blah blah ReSharper...," or some other comment from some jerky developer deeming it useless. Even if you think the rewards aren't that great in terms of orgiastic programming results;
think about your hands (and fingers), and all the wasted keystrokes. Damnit.
<slightDigression>
Scott Hanselman discusses the programmer's hands and how important they are to your career (BC: and of course, your life). Although ReSharper may not indeed save you from some terrible hand condition... Everything helps.
I spent hours a day for years in my past life as a classical musician honing finger movements for ultimate efficiency. Why? Because you want to be able to pick your nose when your 80.
Yes I have a crazy ergo keyboard and trackball rat.
</slightDigression>
In any case. My comment to the unbelievers is:
Have fun wasting your time. [loser]
I am in no way affiliated with ReSharper, JetBrains, or any other Visual Studio plugin like CodeRush. I'm just a coder d00d. But, like me, if you're in a situation where the company you work for supports time-saving tools for their developers, then you need some sort of Visual Studio add-on (or whatever IDE) like this.
I've tried "convincing" other developers and showing them how awesome it is--turning a huge list of private items to public getter/setters should have been enough--but no one seems to care! For me: incorporating, LINQ and extension methods in 3.0 is the best part. For months I dealt with all the broken [looking] LINQ queries with ReSharper 3.1--but no more!
So to anyone that hasn't tried it for Visual Studio 2008... here are the ReSharper 4.0 nightly builds for your pleasure...
And for anyone else I say: remember your digits... and I give thee this.


So, you've got a remote desktop connection that has gone haywire. Looks like explorer has hung up, and crashed.
For some reason you're on your Vista boot camped-MacBook so the Control+Alt+End key combination is nonexistent. You were smart enough to install Launchy 'cuz it rokks and 'cuz Mike Duncan said so. What do you do?! Never fear... Launchy to the rescue!
There are all sorts of hot features with Launchy besides opening applications. Searching google, calculations, weather, indexing... If you're like me, then you like to use your keyboard more than your rat mouse. (I wish I could get a MacBook type trackpad built into my MS ergonomic keyboard). Then I'd give that rodent to the ratatatCATs.
Now at version 2.0 all you need to do is a little Alt+Space action to bring up that beast. Type "explorer" to bring your desktop back from the dead and you're back in business. Baby.















