Wednesday, June 25, 2008
When was the last time you had to interview a .NET developer? Did you know the right questions? If you had some trouble coming up with a good list, you might want to take a look at Scott Hanselman's blog to read what he thinks great .NET developers should know. The list is a few years old, but hey, so is .NET 2.0.
Monday, June 23, 2008
Friday, June 13, 2008
Microsoft has released a new SDK for working with Open XML documents. The SDK extends the existing .NET functionality in System.IO.Packaging to provide strongly typed part classes to manipulate Open XML documents. Pretty handy if you're working with with Word and Excel documents.
I'm currently working through Jeffrey Richter's excellent book Windows via C/C++ and note that he often refers to the Sysinternals tools available on TechNet. Take a few minutes and browse through the list of Sysinternals downloads. ProcessExplorer is on the list and is useful when you need to know what files, registry keys and other objects processes have open, which DLLs they have loaded, and more. Use it as an alternative to the task manager.
Reading through the latest technet bulletin, I see that you can now access all the Sysinternals tools at live.sysinternals.com and even run the tools by opening a command prompt and executing \\live.sysinternals.com\tools\<toolname>. The idea is that you can access and run the tools from anywhere. Some sysadmins may find this useful when scripting but I don't recommend it for interactive tools like ProcessExplorer. I actually had to hard reset my machine after trying! Honestly, the download is only 1.6 MB!
Thursday, June 5, 2008
Click here for an interesting screencast on Vista SP1 user account control. Microsoft have collected user experience stats covering more than 10,000 real world machines and found that after initial setup, 66% of user sessions don't contain UAC prompts. I expect that UAC prompts will become less of an issue in the future as venders update their software to minimise the use of administration permissions. However, if you are an advanced Windows user and want to disable the elevation prompts but still enjoy the protection of UAC, it's really easy to do. Note that this is different to disabling UAC through the security centre.
- Open the start menu
- Type secpol.msc in the search box
- Run secpol.msc by pressing enter
- Navigate through the security settings tree to find Local Policies | Security Options
- Scroll down through the list of policies to find the User Account Control entries
- Select the following policy and open it by pressing enter
Behaviour of the elevation prompt for administrators in Admin Approval Mode
- Choose Prompt for consent from the list of settings
- Press the OK button
From now on, Admin elevations will occur without the prompt. Obviously, this only works if you are an Admin user and UAC is enabled in Security Centre. If you're running Vista with UAC disabled, I recommend that you turn it back on and instead disable the prompt.
Note that Secpol.msc is not available on all versions of Windows Vista but the same result can be achieved through the registry.
- Open the start menu
- Type regedit in the search box
- Run regedit.exe by pressing enter
- Navigate through the tree to find the following key
- Select the following value from the list and open it by pressing enter
- Change the value data from 2 to 0 (zero), as shown below
- Press the OK button
Wednesday, June 4, 2008
Here are a few links for Calista Technologies, one of Microsoft’s recent acquisitions. Calista are working on a visually lossless compression algorithm that enables rich media & 3D graphics on a virtual desktop. Microsoft plans to integrate this technology with Terminal Services to enable DirectX, Vista Aero, WPF applications, full frame rate video and fully synchronized audio.
Monday, June 2, 2008
If you're starting out with globalization and the Windows Presentation Foundation (WPF), then you're in for a real treat. Microsoft has made it easier than ever before to build globalized software. I suggest you start out by reading this overview on the MSDN. You should be able to figure out the rest with a little trial and error. However, if you're too lazy to read the whole article, I've transcribed some concepts below.
WPF offers several paths to resource localization. You can bind localizable resources in your application to an XML file, store text and images in more traditional resource files, or you can markup your localization preferences in XAML with your user interface. Here is an example of how you can apply a localization comment for the benefit of a translator and attribute content as readable but unmodifiable.
"$Content(This is a trademark and should not be translated.)
FontFamily(Font Unreadable Unmodifiable)">
Localization attributes are important because they give you greater control over your resources. In the example, "Microsoft Corporation" is marked as unmodifiable and therefore cannot be changed in a satellite assembly.
The example also illustrates the use the UID property. These identifiers are a necessary part of the localization API and help to track changes in localized resources. You can add these unique identifiers through msbuild by calling msbuild /t:updateuid Sample.csproj.
With the necessary localization markup in place, you need to perform a few more steps before you can produce satellite assemblies. The first is to add the following XML to your project file:
and then add the following attribute to your assembly info file:
[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
Substitute "en-US" in the above for whatever invariant culture you are using. Note that the fallback location is set to Satellite because the main assembly will not contain any invariant resources. This means that the assembly loader will produce a runtime error if you were to remove all the satellite assemblies.
Building the project will now create a satellite assembly for your invariant culture. Now you need a way to export the resources out of your satellite assembly so that they can be translated. You also need a means to generate new satellite assemblies for your target cultures.
As a step towards helping you on your way, Microsoft have create a sample tool called LocBaml that allows you to parse satellite assemblies to create localizable resources and generate a localized binary. The tool will export the resources out to a CSV file that you can give to a translator. Once the CSV file contains the necessary localizations, you simply pass it to the tool and identify the target locale so it can create the new satellite.
Visual Studio 2008 is obviously the latest and greatest IDE released from Microsoft and I'm really impressed with the improvements in the text editor, especially the enhancements to intellisense, refactoring and code snippets. However, I occasionally notice that there are one or two missing features.
I recently posted about the refactoring feature that allows you to organise the using directives in your C# code. This feature works great per file, but there is no solution level option that allows you to organise using directives for multiple files.
Another neat feature in the solution explorer allows you to right-click on a project and open the corresponding folder in Windows Explorer. However, there's no option to open a Visual Studio Command Prompt on the project folder. Furthermore, there should be a shell extension that adds Visual Studio Command Prompt Here to Windows Explorer.
And one more thing, why isn't there a Close All menu item when you open the context menu on the document explorer tabstrip? There's a Close and a Close All But This, but no Close All.
Anyway, if you've noticed some of these missing menu options then I suggest you take a look at the latest drop of PowerCommands over on the MSDN Code Gallery. And while you're at it, get yourself a copy of Ghostdoc. Both are highly recommended.