ASP.NET News from Blogger: eXtensible mind   Get the feed of: eXtensible mind

Total News: 194

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=529BD9445B6...

A better way to encourage contributions to OSS

Currently in the .NET world, most OSS projects are available via a NuGet package. Users have a very easy path towards *using* the project right away. But lets say they encounter some isssue (maybe a b...

A better way to implement the Singleton (anti?) pattern for easier testing using AmbientSingleton

In .NET singletons are typically implemented with a static variable that you control access to: public class SystemClock : IClock { private SystemClock() { } static SystemClock() { Instance = new Syst...

A general purpose event bus leveraging Reactive Extensions

I talked before on the usefulness of having rich events published throughout your domain. In that blog post, I also showed a very simple implementation. I realized that there seems to be quite some in...

Event Centric: super-charge your model with domain events to enable business intelligence

Ive 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...

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) its seen as a UI technique, with s...

How to mock a dynamic object

Someone asked me how to mock a dynamic object with Moq, which might be non-obvious. Given the following interface definition: public interface IProject { string Name { get; } dynamic Data { get; } } W...

Making regex authoring easier to read and maintain

Im spiking ideas on how to make my regular expressions easier to read and maintain for the dev who comes after me (that could be myself in 3 months, meaning I will surely have forgotten everything abo...

Introducing NETFx, or the end of Common.dll and Helpers.dll

From the project home page: What Lightweight NuGet packages with reusable source code extending core .NET functionality, typically in self-contained source files added to your projects as internal cla...

Building NuGet extensions in 10 minutes, or how to contribute to NETFx

From the documentation: How to contribute NETFx relies on the CodePlex mercurial fork/pull process for contributions. The explanation on how to contribute to NuGet applies roughly in its entirety to N...

Querying WCF endpoints using Web API

In previous versions of the Web API, you could query your REST endpoints that exposed an IQueryable<T> server-side, kinda Linq to WCF as @gblock said. This was immensely useful and an importan...

Using Json.NET for text and binary Json payloads with WCF WebApi

There is an aging post by Christian on how to use the awesome Json.NET library as a default serializer for the new WCF Web Api. Rather than having two media type formatters (in the latest bits lingo),...

How to easily test WCF Web Api services

Given the many cross-cutting concerns you can cover using the new Web API pipeline,  its not a bad idea to have a bunch of integration-style tests that cover the actual running service end to end...

Strong-typed access to Thread and AppDomain shared and transient state

Thread.SetData and AppDomain.SetData are sometimes quite useful, when you need to pass state out of band that is shared across an entire call stack in a thread or by an entire app domain. But these AP...

How to use Autofac with WCF Web API

The new configuration model in the latest WCF Web APIs allows extending the service instantiation via what is called a resource factory. For Autofac, I wanted to support a per-request lifetime scope, ...

Writing inline MSBuild tasks in C# for one-liners

Every now and then, when trying to do something in MSBuild, I hit a roadblock (or maybe just some unintuitive feature) and Im left thinking gosh, now I have to create a custom MSBuild task for this on...

How extension methods ruined unit testing and OOP, and a way forward

You probably know Im an advocate of a particular way of doing extension methods that I call the Extension Method Entry Point Pattern, which makes it easier to mock them. This technique, while very use...

How to design a unit testable domain model with Entity Framework Code First

I got this question a couple times already so Ill save keystrokes and post here. I dont like the Repository pattern too much either, especially since the advent of IQueryable and Linq, which make it m...

How to send URL shortcuts to a specific browser such as Internet Explorer

IE is not my default browser. But still some links have to be sent to it in order for the right thing to happen (i.e. Microsoft Lync invitations, Live Meeting, InfoPath forms, etc.). So far I had the ...

How to flash, root and SIM unlock a Galaxy Tab

These instructions worked for me on two AT&T devices, 850/1900 WCDMA (the one that works in Argentina), model SGH-i987 to be precise. AT&T decided to cripple its ROM for the Galaxy Tab: it doe...

How to make all non-virtual members virtual

Using a simple find & replace with a regex in VS2010: This will match all public instance members that do not have the virtual keyword and make them virtual. (go one by one, as it will also match...

Team and OS resilient assembly references for Visual Studio Extensibility development

If you just go and use the VS Add Reference dialog to pick assemblies from the PublicAssemblies or PrivateAssemblies or the Visual Studio SDK installation folder, you will end up with references that ...

Reactive Framework Extensions Generator

You probably know already that the Reactive Framework Extensions (Rx) is a new library on top of .NET 4.0 and Silverlight that allows developers to leverage the expressiveness and power of LINQ for .N...

The myth that TDD or test-first slows you down is true

I'm sad to say it, but it is true. It slows you down. But not everytime, and not for everything. So let's be more specific on the cases where it DOES slow you down noticeably: Cowboy or Duct Tape Pr...

How to always open the vsixmanifest in XML view

The new VSIX projects contain a manifest that is by default opened with a designer. No matter how many times you specify that you want to open it with the XML editor by default, VS will continue to op...

Linq to Mocks is finally born

Last time I announced Linq to Mocks, some said Moq didn't actually have anything to do with Linq. Despite the heavy usage of lambda expressions and expression trees, the ""q"" in Linq is for ""q...

Improved type safety when dealing with generic types, generic methods and reflection

Compile-time safety is always important, as it reduces the chances that a refactoring can break existing code that compiles successfully. This benefit took me previously to the path of using expressio...

Why Embedded Silverlight Makes Sense

So Microsoft just shipped Silverlight 3.0. Outstanding achievement in its own right for a company that takes multi-year cycles for pretty much every product, if you ask me. Silverlight is indeed a ver...

MAB ContainerModel / Funq: a transparent container

From the point of view of the user of the container, he doesn't have to do anything at all. He just creates classes as usual: public class EditCustomersPresenter { public EditCustomersPresenter(...

Mobile Application Blocks ContainerModel / Funq: an introduction

If you follow my blog, you probably heard about Funq, and maybe you even watched the screencasts I did about it while developing it (yeah, I'm missing a bunch of new ones!). When we started working ...

Announcing the free ViewModel Tool

If you're doing any kind of WPF development, you probably read at least some of the links in this entry on WPF Patterns. One common theme across all variants of the ViewModel pattern is that it always...

What would you like to see in Enterprise Library 5.0?

There are few groups within Microsoft that are as open and so quick to deliver as patterns & practices. When you give them feedback or request features, chances are you'll see them implemented wit...

Crazy Linq: replacing multiple and nested foreach statements with a query

Objective of the method: determine whether the given EnvDTE code class contains the given GeneratedCodeAttribute: ""old"" foreach/if approach:private bool IsPresentationModel(CodeClass2 baseClass)...

A picture is worth a thousand words: is XML dying?

(does that answer Jeremy's question too?) ...

Approaching Behavior Driven Development (BDD) from a Test Driven Development (TDD) perspective

Over the years doing TDD, I'm getting increasingly concerned about the value my test fixtures are bringing to the table in terms of documenting features and expected behavior. So far, I followed the t...

Making WCF services amenable to testing

You know that using WebOperationContext.Current is BAD for making your service implementation testable, don't you? My friend Pablo Cibraro continued to evolve his ideas around decoupling your service ...

Moq 3.0 RTM!!!

I've just released the latest version of Moq :)))) It's quite late on an intense week at Redmond, so I'm just going to paste the relevant portion of the changelog:Version 3.0 * Silverlight support!...

Freeing up data and collaboration via the mesh

Last weekend, during the ALT.NET Seattle conference, I spoke for quite a while with Miguel de Icaza on the work we're doing with InSTEDD in the area of data synchronization. He was very excited, and w...

Leveraging ILMerge to simplify deployment and your users experience

ILMerge is one of those little-known gems that are an absolute must-have once you know how to apply them effectively to scenarios you didn't even think about. Specifically, whenever you work on a mult...

Making extension methods amenable to mocking

The question of how to mock extension methods comes up frequently enough that I though I might give my opinion and solution to it (which does NOT include using TypeMock ;)). A first differentiator is ...

How to upgrade Atom 0.3 feeds on the fly with a custom XmlReader for use with WCF Syndication APIs

Even now that Atom 1.0 has been approved and official for some time, there's a feed every now and then that still uses Atom 0.3 (i.e. Google News! http://news.google.com/?ned=us&topic=w&output...

Funq: screencast series on how to building a DI container using TDD

Over the past few days, I spent some time recording the experience of building a dependency injection container using test driven development. It was a cool experience for me, and I hope you find the ...

Funq Part VI: adding deterministic disposal of container hierarchies and instances created by them

Now available at Funq Part VI- building a fast DI container with TDD Enjoy! ...

Funq Part VII: polishing a fluent API

Now available at Funq Part VII- building a fast DI container with TDD Enjoy! ...

Funq Part VIII: adding support for initializer functions

Now available at Funq Part VIII- building a fast DI container with TDD Enjoy! ...

Funq: applying TDD to build a dependency injection container you can understand

I'm planning to record a series of screencasts which will serve as walk-throughs on how to apply TDD on a practical project consisting in building a full-featured and high-performance DI container whi...

Funq Part I: selecting a high performance approach and building the basics with few lines of code

The first screencast is up! I'll post higher resolution downloads later on. Video: Funq Part I: Building a fast DI container with TDD Enjoy! ...

Func Part II: adding support for passing constructor arguments to resolved instances

Second screencast is up! Video: Funq Part II: Building a fast DI container with TDD Enjoy :) ...

Evolving an API without breaking clients via extension methods, ObsoleteAttribute and EditorBrowsableAttribute: Part II

Due to a bug in VS intellisense (go vote for it!), my otherwise nice approach to API evolution doesn't quite work as I expected. Basically, regardless of whether you flag your obsolete methods (extens...

Evolving an API without breaking clients via extension methods, ObsoleteAttribute and EditorBrowsableAttribute

API evolution is tough and versioning is a complex enough issue that deserves not one but several posts. So I will only focus on one specific kind of evolution and backwards compatibility: Source Comp...

View Other bloggers