Articles
Programming - Sub Categories
- HTML (0)
- Javascript (0)
- PHP (0)

So, are YOU going to DevConnections 2008 at Mandalay Bay? (See pathetic poll to the right).
This is my second time to vegas in <6 months and this time, I'm hoping to check out Alex, Picasso, and Ed Roman Guitars.
I'm going with a bunch of guys from w0rk. Should be fun, though I've read some not-so-good reviews of our hotel... (Can't be the Venetian every time...)

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... who's going to OWASP NYC AppSec 2008 Conference?? It's coming up very soon...aka NEXT WEEK!
I'm looking forward to the following talks...
· Get Rich or Die Trying - Making Money on The Web, The Black Hat Way (HOT!)
· Next Generation Cross Site Scripting Worms
· Bypassing web application/service security controls using Encoding, Transcoding, Filter Evasion, and other Canonicalization Attacks

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>














