October 2010, links

Ten caching mistakes that break your app from CodeProject.

Stuxnet is a Windows-specific computer worm. It is also the first known worm to target critical industrial infrastructure. The complexity of the software is very unusual for malware. The attack requires knowledge of industrial processes and an interest in attacking industrial infrastructure. It is digitally signed with two authentic certificates which were stolen. These capabilities would have required a team of people to program. Writing the code would have taken many man-months, if not years. Stuxnet: A possible attack scenario.

Video Introduction to the STL, Part 1 to 5.

TechNet Magazine (September 2010) writes about Top 10 Virtualization Best Practices.

Larry Osterman: It’s a bad idea to have a TEMP environment variable longer than about 130 characters

Wired.com interviews Bjarne Stroustrup.

SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion).

Ed Guzman: Delegates in C# – attempt to look inside.

VS2010: Project not selected to build for this solution configuration

Along with everyone we are moving towards 64-bit platforms. After adding solution platform x64 under Visual Studio 2010 Configuration Manager, everything seemed ok.

When building, all builds was successful except x64 Release. Here is an output:
1>------ Skipped Build: Project: abc, Configuration: Release x64 ------
1>Project not selected to build for this solution configuration
2>------ Skipped Build: Project: def, Configuration: Release x64 ------
2>Project not selected to build for this solution configuration
...
========== Build: 1 succeeded or up-to-date, 0 failed, 27 skipped ==========

After some digging I found that solution file (.sln) is damaged. Some forum posts suggest to recreate solution and add all project again.

Then if you compare old (broken) .sln file and new .sln file, you notice that old file is missing some ‘Build.0’ entries for x64 platform:
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.ActiveCfg = Debug|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.Build.0 = Debug|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|x64.ActiveCfg = Debug|x64
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.ActiveCfg = Release|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.Build.0 = Release|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|x64.ActiveCfg = Release|x64

To fix, add the missing entries:
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.ActiveCfg = Debug|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.Build.0 = Debug|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|x64.ActiveCfg = Debug|x64
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|x64.Build.0 = Debug|x64
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.ActiveCfg = Release|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.Build.0 = Release|x86
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|x64.ActiveCfg = Release|x64
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|x64.Build.0 = Release|x64

If you have MS Setup Projects (MSI), then you will have 8 entries without final platform specifier:
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.ActiveCfg = Debug
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|Win32.Build.0 = Debug
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|x64.ActiveCfg = Debug
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Debug|x64.Build.0 = Debug
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.ActiveCfg = Release
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|Win32.Build.0 = Release
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|x64.ActiveCfg = Release
{062214D2-863B-4F1F-9631-23D9DF8D181D}.Release|x64.Build.0 = Release

If you have relatively small number of project I suggest you to go with recreating solution path, because it is very easy to make mistake by editing .sln in text editor.