Sunday, September 06, 2009

.Net Code Contracts + XML Comments = (as good as) peanut butter and chocolate?

Peli's Farm - Pex, Stubs, QuickGraph, MbUnit, Reflector Addins - Code Contracts.Net to Xml Comments!

“The new release of Code Contracts is out and brings a very cool feature: Xml comment generation. This means that you do not have to worry about keeping the comments in sync with the code, the compiler takes care of this.

Contracts to Xml Comments in action

Unless you invest a lot of work in them, Xml comments are most often worthless. …

However, the body of the constructor contains Contracts that state the pre-conditions and post-conditions of the constructor: source and target should not be null, etc… With the new xml comment generation, these contracts will be added to the xml documentation and ultimately will show up in the compiled documentation.

Finally, we run the documentation file through Sandcastle*** to get the final result..

image_18

…”

Now that’s pretty cool and very logical. It seems a prefect way to extend and enhance our generated doc’s.

.Net Code Contracts is something I’ve been lightly following on a low priority background thread, waiting for it to bake a little more. Seeing this, I think I’m going to have to increase the priority on that thread. (Yeah it’s a little thing, but little things add up to some pretty big things… ;)

A Feed You Should Read #2 - Chris Alcock’s Reflective Perspective (The Morning Brew)

In my second “A Feed You Should Read” I’m continuing with some of the link bloggers I read.

One of the early must read blogs was the “Daily Grind” which sadly is no more (we miss you… ). Yet all is not lost.

Taking up the mantle of the Daily Grind, Chris Alcock jumped into the breach with “The Morning Brew”. While we miss the Grind, the Morning Brew is a great blend and has an outstanding flavor… ;)

Chris Alcock - Reflective Perspective

image

Background:

Chris’s The Morning Brew has been about for almost three years now, since January 2007, and I’ve been follow it since its start, or close to it at least (looks like my first link to it was to #37)

The Morning Brew is a link blog, but with a twist. In addition to the links, there’s brief description of that link’s content. Think of it like a Link Blog++

Why do I like this feed and think you might also?

It’s both the content of which Chris links to, which is basically Microsoft development/tech related, and the “extra” depth he provides.

Not only are well focused and categorized links provided, but an extra level of depth.

Sometimes it’s hard to tell if a link in a link blog is worth a click-though just based on its title. Yet each click-through that isn’t what you might have thought it was costs you time. The extra descriptions Chris includes with his links help a great deal toward determining if you should invest your time or not.

You can think if it like links with description attributes being applied… (sorry… a dev joke… ;)

As icing on the cake, he and I seem to read many of the same blogs, yet being in the UK, provides a different perspective on things, which helps me broaden my own. There have been a number of times where I’ve missed something, or glossed over it, but in reading about it on his blog realized that I needed to take a second look.

If your time is limited, yet would like to keep up on the goings on in the Microsoft Development sphere, I recommend you place Chris Alcock - Reflective Perspective and The Morning Brew in your “must read at the start of the day” feed folder.

Snap of today’s post:

The Morning Brew #426

image 

Blog Information:

Name: Reflective Perspective - The caffeine fueled thoughts of a UK Software Developer and home of ‘The Morning Brew’
URL: http://blog.cwa.me.uk/
Feed: http://feeds.feedburner.com/ReflectivePerspective
Post Types: Primary – Links (The Morning Brew)
Secondary - .Net, SQL Server, Microsoft based development related topics

Friday, September 04, 2009

Compress and pack your next .Net deployment with open source NETZ

MadeBitsNETZ

NETZ is a free open source tool that compresses and packs the Microsoft .NET Framework executable (EXE, DLL) files in order to make them smaller. Smaller executables consume less disk space and load faster because of fewer disk accesses.

Unlike other portable executable (PE) packers, .NETZ uses a pure .NET solution and it is written in C#. .NETZ can be used to pack .NET executables written in almost every .NET language.

.NETZ supports both .NET EXE and non-shared DLL files, and it is intended to pack .NET desktop applications. The compressed applications can be used in the same way as the uncompressed ones, transparently to the end user.

…”

NETZ - Download .NETZ

image

NETZ - .NETZ Help and Usage Examples

“For a quick start read Packing EXE Files and Creating a Single EXE File (EXE+DLLs), to pack together DLLs and the main EXE file into a single executable.


The .NETZ tool can be used to transparently compress .NET standalone EXE files and non-shared DLLs (with some limitations). For best results, download a version of .NETZ compiled for the version of .NET Framework that you are using.

.NETZ is a command-line tool. All examples below should be typed in a CMD window (or placed in a batch *.BAT file for your project, that can be run as a post-build step from within Visual Studio IDE).

…”

I came across this yesterday and thought it was pretty cool. The coolest in my mind was that the C# source is fully available.

And I’ve always liked the idea of combining my DLL’s into my EXE (i.e. ILMerge) to simplify deployment. XCopy is cool, but it’s even cooler if all you have to redist is a single EXE…

(cough… it would be coolest if Visual Studio had something like this, or just ILMerge, baked in… so that VS would, optionally, do the merging/packing/etc without us having to use a third party/external utility… cough… ;)

 

Related Past Post XRef:
Have a bunch of referenced DLL’s cluttering up your deployment? Just say no and ILMerge them…
Automate ILMerge'ing - Using Project Attributes to mark an Assembly for merging and then MSBuild to ILMerge them...
Gilma - GUI for ILMerge Branched for .Net 2.0
VS2005 Power Toys Pack Installer
MSBuild and ILMerge
"Gilma - GUI for ILMerge Application"
ILMerge Updated
The Code Project - Merging .NET assemblies using ILMerge - .NET

Thursday, September 03, 2009

Some samples to get your gadgeting going – Your Windows Sidebar gadget, that is…

Microsoft Downloads - Gadget Samples for Windows Sidebar

“Sample gadgets that demonstrate the functionality of the Windows Sidebar scripting elements.

File Name: GadgetSamples.EXE
Version: 1.0.0.2
Date Published: 9/3/2009
Language: English
Download Size: 605 KB


Overview

These gadget samples are intended to demonstrate the functionality of the Windows Sidebar scripting elements. Most of the code snippets found throughout the Sidebar Reference documentation are extracted directly from the gadget code provided here.

Here’s a rundown and brief description of each of the gadget samples:

Hello World
Demonstrates a simple 'Hello World' gadget.

Flyouts
Demonstrates gadget flyout functionality.

Settings
Demonstrates gadget settings functionality.

Docking
Demonstrates the gadget docking functionality.

Debugging
Demonstrates gadget debugging functionality.

Text and Graphics
Demonstrates the g:background, g:image, g:text elements and the gimage protocol of the Windows Vista Sidebar.

…”

Samples are good, I like samples. With the success that Windows 7 will be, maybe Sidebar Gadgets will have a resurgence…

It’s a shame there are not some new, cool ones in the Win7 box. Is the fact that there are not an indicator that there’s no long term (post-Win7) gadget viability? Or just that Microsoft was focused on the guts more than the glitz in Win7?

If we see some “Gadget Packs” from Microsoft next year, that could answer the question (for if there’s no gadget love in 2010/2011 then I’d bet against Gadgets in Win8… but that’s just my WAG  ;)

 

Related Past Post XRef:
Creating Vista Sidebar Gadgets in Visual Studio (C#) – The Getting Started Guide
Windows Sidebar Gadget Development Tutorial
Developing a Weather Vista Sidebar Gadget (C#)
VS 2005 Vista Sidebar Gadget Template
Vista Sidebar Gadgets - Beyond the toy zone...

Vista Sidebar Gadgets for Developers

Vista Windows Search Indexer Sidebar Gadget – Do you know what your Indexer is doing?
Free SQL Server Monitor Gadget for your Vista Sidebar
Speedfan Vista Sidebar Gadget - Speedfan Meter

What’s new in C# 4.0 and four ASP.Net MVC posters added to DRP/www.drp.co.za

ZaydKara - New Posters added to www.drp.co.za

“Check out our new posters added to the DRP Site in the Development category, created by my fellow colleagues, Rein Hillman and Robert MacLean visit Robert's blog.

image

…”

DRP

“New Posters Added - Thursday, September 03, 2009

We are pleased to announce that the following new exciting Posters have been added under our Development category:

  1. What's new in C# 4.0
  2. ASP.NET MVC Controller Cheat Sheet
  3. ASP.NET MVC Framework Cheat Sheet
  4. ASP.NET MVC Proven Practices Cheat Sheet
  5. ASP.NET MVC View Cheat Sheet

…”

DRP - Posters > Development

image

DRP has done it again with a batch of very cool posters.

While you’re there you have to spend a bit of time going through their other outstanding posters. (I’m telling you, you’ll kick yourself if you don’t… been there, done that, got the burse… ;)

 

Related Past Post XRef:
TFS Roles and Security Quick Reference Poster
Ever wondered what a diagram of the TFS 2008 Team Build Process would look like? Wonder no more...
New TFS & PowerShell (Beta) Posters from DRP
TFS (and many more) Posters

Easy image resizing for the digital camera happy - Image Resizer Powertoy clone for Vista & Windows 7 (32 & 64 bit)

AVIRAJ AJGEKAR'S BLOG... - ImageResizer for Windows XP & Windows Vista/Windows 7 (both 32-bit/64-bit)

“…

Many of them use these for sharing with their friends and families. Often users try to mail these pictures over the email or instant messenger by zipping them but it does not help much. Approximately a 5 MB images will be compressed to up to 4 or 4.5 MB but that is also the very high size per image sending via email or messenger. Sometimes we use our trustful Microsoft Paint application for resizing images, which is cool but again for a single or couple of images it is ok to open up the image and to “Save As” Well imagine what if you have around 20 30 40 50 100+ images for resizing. Then it is a painful task for doing manual resizing.

What’s the solution?

Well, the solution is to use a Image Resizer tool that we would talk about. An easy to use tool for resizing multiple images within few seconds. We are talking about ImageResizer PowerToy that was available for Windows XP and folks at CodePlex re-written the same application in C++ for Windows Vista & Windows 7 including support for 64-Bit version of Windows.

…”

CodePlex - Image Resizer Powertoy Clone for Windows

Project Description
This is a clone of the Image Resizer Powertoy for Windows XP -- a PowerToy that allows you to right-click on one or more image files in Windows Explorer to resize them. This clone was created to extend support to non-XP and 64-bit versions of Windows (including Windows 7 & Vista)

ShortcutMenuBasic 

…”

Image Resizer Powertoy Clone for Windows - Image Resizer 2.0

“…

ImageResizer-2.0.msi
application, 2111K, uploaded Apr 17…

ImageResizer-2.0_x64.msi
application, 1606K, uploaded Apr 17

ImageResizer-2.0.zip
source code, 30K, uploaded Apr 17

Release Notes

Version 2.0 of Image Resizer Powertoy Clone for Windows has been re-written in C++. Because of this, 64-bit is now supported! Also note that the Alternate UI application has been removed (as it should no longer be needed).

ChangeLog
Since the Beta:

  • Input validation.
  • 12 MB smaller setup file. (Work Item #1230)
Since version 1.1:
  • Windows 64-bit support. (Work Item #480)
  • Alternate UI removed.
  • Simplified setup.
  • License changed to EPL.

…”

And here I was the other day manually resizing some images. I’d forgotten all about this utility… sigh. Funny that I first blogged about the original two years ago almost to the day.

(via @shanselman- tweet)

 

Related Past Post XRef:
Image Resizer PowerToy for XP and Vista - Easy Resizing of Images, Pictures, Digital Photos, etc via Windows Explorer

Wednesday, September 02, 2009

Scott Hanselman has updated his monster (and must read) “Ultimate Developer and Power Users Tool List for Windows”!

Scott Hanselman's ComputerZen.com - Scott Hanselman's 2009 Ultimate Developer and Power Users Tool List for Windows

“Everyone collects utilities, and most folks have a list of a few that they feel are indispensable.  Here's mine.  Each has a distinct purpose, and I probably touch each at least a few times a week.  For me, util means utilitarian and it means don't clutter my tray.  If it saves me time, and seamlessly integrates with my life, it's the bomb. Many/most are free some aren't. Those that aren't free are very likely worth your 30-day trial, and perhaps your money.

This is the Updated for 2009 Version of my 2003, 2005, 2006, and 2007 List, and currently subsumes all my other lists. Link to http://www.hanselman.com/tools when referencing the latest Hanselman Ultimate Tools List. Feel free to get involved here in the comments, post corrections, or suggestions for future submissions. I very likely made mistakes, and probably forgot a few utilities that I use often.

…”

ZOMG. I’m a giddy as a schoolgirl, an updated “Ultimate Developer and Power Users Tool List for Windows”!

To give you a feel of the full list (see… yeah… WOW… that’s a list!)…

Scott Hanselman's Computer Zen - Scott Hanselman's 2009 Ultimate Developer and Power Users Tool List

As I said, a must read for all MS tech-sphere developers and power users…

Please note Scott’s call for charity donations to American Diabetes Association. If you like his list and find it useful then please pay it forward and donate (been there, done that, answered his call… :) This list is a labor of love, and you can share in that with a quick donation.

 

Related Past Post XRef:
It's that time... Scott's Ultimate Developer and Power Users Tool List for 2007
Scott Hanselman's 2006 Ultimate Developer and Power Users Tool List for Windows is Out
Scott Hanselman's 2005 Ultimate Developer and Power Users Tool List
Scott Hanselman's [2003] Ultimate Developer and Power Users Tools List

Unit testing database code via mocking/isolation and the Repository pattern - “Eliminate Database Dependencies in Test-Driven Development”

Visual Studio Magazine - Eliminate Database Dependencies in Test-Driven Development

image

Many developers are tasked with writing unit tests as test-first design and development becomes commonplace, even on teams that aren't strictly practicing Agile methodologies. Test-driven development (TDD) can produce cleaner code by requiring project teams to first write unit tests that fail, then program just enough code for a needed function, retest, refactor and repeat the cycle. If you haven't written code using TDD, starting from a failing test sounds awkward. But it's this extra bit of thought about what you want to achieve that gives you a clearer understanding of what you need to accomplish.

If you're writing an n-tier application using Visual Studio and you're using TDD, it's not uncommon that your unit tests for business-tier functionality read and write to a database. In order for these tests to run, you need a running database with the most up-to-date schema along with any supporting data.

In this article, I'll show you how to leverage the Repository pattern to eliminate the dependency on SQL Server from your unit tests and, in the process, improve your application's testability. The unit-testing features that I discuss in this article are all available in Visual Studio 2008 Professional Edition and in all Visual Studio 2008 Team Editions. The sample application is written in Visual Studio 2008 Team Suite and requires an instance of SQL Server or SQL Express. See the readme.txt for information about how to set up the database and where to find the connection string.

…”

This is one of the challenges in our code base, it’s very old (sigh.. upgraded from VB6… sigh… but it works at least…  ;) and was not designed for isolation nor unit testing. Not that we don’t test! We have thousands of tests in our CI process, but those are really “integration” tests and not “unit” tests. While I’m nowhere near a test zealot, I would really like to be able to execute some DAL testing without having to jump through database setup/rollback/etc hoops.

That’s why this article caught my eye. Added to my stack of stuff to read and grok… ;)

(via Benjamin Day Consulting, Inc.: The Blog - Article: “Eliminate Database Dependencies in Test-Driven Development”)

Tuesday, September 01, 2009

Up to 25% off many Microsoft Exams – We’re talking 74 exam’s that are 15%, 20% or 25% percent off (worldwide, but limited time offer)

Microsoft SMB Community Blog - Get up to 25% off Microsoft certification exams! But act now!

“How would you like to save 15-25% off of your Microsoft certification exams?  Well, that’s exactly what Microsoft if offering right now on select exams to make it easier for you to obtain your Microsoft certifications.  Using these exams, here are just a few of the certifications you can work towards, plus much more:

  • Microsoft Certified Technology Specialist (MCTS) certifications – These provide the foundation for Microsoft Certification. These certifications are designed to validate your skills on the features and functionality of key technologies. You can show your depth of knowledge in one specific technology, earn multiple MCTS certifications to show breadth across different products, or build on the MCTS to earn a Microsoft Certified IT Professional (MCITP) credential or other Microsoft Certified Professional credentials.
  • The Microsoft Certified Professional (MCP) credential: This validates that an individual has the comprehensive set of skills necessary to perform a particular job role, (for example, desktop support technician, database administrator, enterprise messaging administrator, or developer related skills). Some of the MCP certifications available include Microsoft Certified IT Professional (MCITP), Microsoft Certified Professional Developer (MCPD), and Microsoft Certified Database Administrator (MCDBA). These certifications build on the technical proficiency measured in the MCTS certifications.

Some things to note: This offer is available worldwide and is good until December 31, 2009, or while supplies last.  To take advantage of this, you must register, schedule, and purchase your discounted exams by December 31, 2009.

Get your voucher code for your discounted exams - Register through Prometric to obtain your discounted voucher code; once you have obtained your code, plan and schedule your next exam. Vouchers can be redeemed only at authorized Prometric testing centers.

…”

image

Microsoft Learning - Career Campaign: Certification Exam Offer

699x130-career-portal-banner 

Get up to 25 percent off select Microsoft Certification exams

Microsoft Certification can help you pursue a new career in IT, move from one job role to another, or become indispensible in your existing role. To make it easier, you can take advantage of discounts that Microsoft provides on select Microsoft Certification exams.

Microsoft Certifications are continually evaluated and updated to ensure their relevance in the marketplace. As a result, earning a certification not only helps you stay current on the latest developments in Microsoft technologies and platforms; it also enables you to demonstrate to employers your job skills.

Note This offer is available worldwide and is good until December 31, 2009, or while supplies last. Customers must register, schedule, and purchase their discounted exams by December 31, 2009. Microsoft does not guarantee that customers will pass their exams. This offer does not include Academic exams.

image

25% off is a very nice discount… And it’s worldwide… So go test baby, TEST!

A SketchFlow Two-fer day - “Shawn Wildermuth on SketchFlow/dnrTV” and “Prototyping a WPF-3D game design workflow using TrueSpace 3D, Expression Blend 3 with SketchFlow, and exporting the prototype to XNA Game Studio.”

Shawn Wildermuth - My SketchFlow .NET Rocks TV Episode is up (DNR-TV)

“URL: http://dnrtv.com/default.aspx?ShowID=148

I am excited to announce that my new DNR-TV episode is up at .NET Rocks. Carl and I visited while we were both at DevTeach to show off Blend's new SketchFlow functionality. If you have time, give it a spin!”

dnrTV - Shawn Wildermuth on SketchFlow

“In this the second or two episodes that Carl and Shawn recorded last month at DevTeach in Vancouver, Shawn shows us Microsoft's new SketchFlow. SketchFlow is a prototyping tool that will actually generate a framework of code that can be used to start your .NET project.

…”

AND

Development in a Blink - SketchFlow – Not just for Artists. It’s a revolution in your workflow

“UML can really reduce your costs. While SketchFlow is not UML it gives the same benefits and more…”

Designing for .NET - Prototyping a WPF-3D game design workflow using TrueSpace 3D, Expression Blend 3 with SketchFlow, and exporting the prototype to XNA Game Studio

“…

One Ring to Rule Them All…

What makes SketchfFow so very important is it isn’t just a feature of Expression Blend but a technology you can use elsewhere across the board in your development and designs. Whether you are doing 2D and 3D for a video game or you are doing Mobile phone development. SketchFlow isn’t dependent on you designing or developing for even the Windows platform.

Let’s take a fictitious project here from concept to finish..

Let’s take a look at how we could use this with some other tools..

XNA Game Studio 3.1 Development

While XNA Game Studio for Visual Studio is a great engine for developing 2D and 3D games for Windows, the X-Box 360 and Zune music player platforms, it isn’t always easy to visualize how a screen might get laid out or work.

What do people use today to created game storyboards? A Napkin? Visio, Photoshop? PowerPoint? If you ask someone they will tell you a number of different things. Everyone has a different concept of the work..

Let’s say I want to develop an arcade game where I have little  creatures running around trying to eat me. While I run around and hop up and down some platforms in a sort of maze while avoiding dangers.. We have all heard this story before right? Well let’s update this a little bit.. And work through the concept.

…”

The important thing I’m walking away with is that SketchFlow is not just for designers…

 

Related Past Post XRef:
Four Expression 3 Starter Kits, two for Blend and two for Web, focusing on Sketchflow, Gaming, SuperPreview and SilverLight.