Fridathon: unstructured learning or hacking you can opt-in to do on any random Friday.
  • How to apply build configuration transformations on non-web projects

    This is a pretty common request, and the simple answer is available in SO: right after the C# targets import, add the following: <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" /> <Target Name="AfterCompile" Condition="exists(\'app.$(Configuration).config\')"> <!-- Generate transformed app config in the intermediate directory --> <TransformXml Source="app.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="app.$(Configuration).config" /> <!-- Force build process to use the transformed configuration file from now on. --> <ItemGroup> <AppConfigWithTargetPath Remove="app.config" /> <AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config"> <TargetPath>$(TargetFileName).config</TargetPath> </AppConfigWithTargetPath> </ItemGroup> </Target> [Read More]
  • How to map a shared SkyDrive folder as a network drive in Windows

    Open the folder in the skydrive site using the browser (it would be under Shared menu on the left). The url will look something like: https://skydrive.live.com/?cid=529BD9445B66F60D&id=529BD9445B66F60D%21189#cid=529BD9445B66F60D&id=529BD9445B66F60D%21189. Now the “cid” query parameter in the URL. Right-click on Network (in windows explorer), then “Map Network Drive” Specify Folder as: https://d.docs.live.net/[cid]/[folder_name]. For the sample URL above, it would be https://d.docs.live.net/529bd9445b66f60d/CQRS (note the folder name isn’t in the URL, you need to know it beforehand, and it has to match what it’s named on the site). Check the “Use alternate credentials” option in the dialog: [Read More]
  • Event Centric: storing and consuming events

    [Disclaimer: I don’t think this disclaimer is needed, but just to be on the safe side. The opinions expressed herein are my own personal opinions and do not represent in any way my company’s view, that of any customer current or past, or any current, past or future project related to these concepts that I may participate in] [Read More]
  • Event Centric: super-charge your model with domain events to enable business intelligence

    I’ve shown in my previous post how interesting domain events can be mined using the Reactive Extensions for .NET. Now we need to raise those events when things happen to our domain. The typical way you’d publish events from your domain is simply adding .NET events. Say we have a Patient class, with a method Admit that causes the patient to be in the hospital and tracks the date when he was admitted: public class Patient { public DateTimeOffset? AdmittedDate { get; private set; } public bool IsInHospital { get; private set; } public void Admit(DateTimeOffset when) { if (this.IsInHospital)... [Read More]
  • Event Centric: finding key business value by leveraging domain events and reactive extensions

    Reactive Extensions (Rx) is one of the coolest additions to .NET ever. However, they have been largely ignored by the mainstream, in a significant part because (IMO) it’s seen as a UI technique, with samples that show how to handle mouse moves, drag & drop and so on. Its focus on asynchronous programming too makes it look like a niche technique that might even be worth skipping over as we wait for C# 5.0 async keyword (see Mike’s blog entry on a possible clarification of where it might fit in the async world). [Read More]