Microsoft .Net Security Code Examples

I came across this channel 9 Microsoft Security Wiki that contains some nice code examples for common security programming tasks (in C# and VB.NET), such as generating cryptographically secure random numbers. Not only does it show the correct way to perform a task but also provides ‘how not to’ example code.

Patterns and Practices: Guidance Explorer

The Patterns and Practices Team continue to have a major impact on software development both inside and outside Microsoft. Their latest offering is Guidance Explorer.

Guidance Explorer allows you to create and distribute a set of standard performance and security best-practices that your team can adhere to.

From J.D Meier’s blog: “Guidance Explorer is a new, experimental tool from the patterns & practices team that radically changes the way you consume guidance as well as the way we create it. If you’ve felt overwhelmed looking across multiple sources for good security or performance guidance then Guidance Explorer is the tool for you”

It’s currently aimed at ASP.NET, but windows guidelines are apparently in the pipeline. I’ve just downloaded it, and I might blog my experiences later…

Visual Studio 2005 Icon Library

Did you know that Visual Studio 2005 ships with a library of standard windows bitmaps, cursors, icons and metafiles which can be freely used in your windows and web applications? It contains Windows, Office, and Visual Studio icons that are licensed for reuse.

You can find it here: C:\Program Files\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary\VS2005ImageLibrary.zip

In addition the .ico files are in multi icon format with the 16×16, 32×32, 48×48 images (and color depth 256, 16bpp, 24bpp) contained in a single file.

Skyscrapr

If you’re an architect or an aspiring architect, check out skyscrapr. The site was recently launched by Microsoft (May, 2006), and plans to cover all aspects of architecture.

Introduction to Test-Driven Development

This is old news but worth mentioning if you haven’t already seen the Introduction to Test-Driven Development webcast by Peter Provost, Scott Densmore, Brad Wilson, Brian Button and Ron Jacobs, and you would like to know more about Test-Driven Development (or even if you are a sceptic!) then download and watch this webcast. Not only is this a gentle introduction to Test-Driven Development but it’s also quite funny!

Ron Jacobs also hosts ARCast which has some excellent content. Ron is “…Someone who understands what you are thinking… someone who can tell a good joke.” He also seems to have an infectious sense of humor!

Simian: A tool for Detecting Similar Code

Simian is a code similarity analyser that can be used to identify duplication in “…any human readable files…”. Simian runs natively in any .NET 1.1 or higher supported environment and on any Java 1.4 or higher virtual machine.

Howard van Rooijen shows how to integrate Simian into Visual Studio here Detecting duplicate code with Simian and also how to make it more usuable here MonkeyWrangler – Making Simian more usable in Visual Studio

To incorporate it into your NAnt automated build scripts, create a simian target:

<property name=”Exec.Simian” value=”C:\BuildTools\simian-2.2.8\bin\simian-2.2.8.exe”/>

<target name=”runSimian” description=”Runs Simian to find duplicate code”>

<exec program=”{Exec.Simian}"></span>        <span style="color:blue;"><</span><span style="color:maroon;">arg</span><span style="color:fuchsia;"> </span><span style="color:red;">value</span><span style="color:blue;">="-recurse={project.root}\*.cs”/>

<arg value=”-formatter=xml:${build.outputfolder}\simian.xml”/>

</exec>

</target>

The latest version of CruiseControl.Net already contains the necessary .XSL formatter to display the results in the CC.Net dashboard, just point it to the simian.xml output file.