The previous post talked about the issues with supporting DI in WF4. The nature of Windows Workflow means that there is no true support for DI. Using a custom extension and activity will allow for pulling in dependencies to a workflow while catering for the concerns outlined in the previous post. This series will refer to the dependency injection concept as dependency resolution because this technique is more aligned with the Service Locator pattern than DI.
This first part will go through the d...
[More]
Tags: Dependency Injection, WF
395deb56-ea46-4b15-9054-49830c3bbd60|0|.0
I’m a fan of DI for all the benefits that it brings. Unfortunately dependency injection is not really supported with Windows Workflow. DI is a pattern in which dependencies are calculated outside an entity and provided to the entity for it to use. The DI container is responsible for creating and managing these dependencies and injecting them onto the entity. WF does not fully support this model. Any dependencies calculated outside a workflow must be provided to the workflow execution engine a...
[More]
Tags: Dependency Injection, WF
e755620e-6718-4e6f-8167-b58732d2a9ce|1|3.0
This has been a curly one for a few months and I’ve finally had some time to resolve the issue. My team has been running TFS Build 2010 with gated check-ins where the build does MSI deploys then runs unit and integration tests. All of a sudden the builds started failing with no indication as to why. The build activity log just stops and does not contain errors. The MS build log file also does not contain any errors. The event log on the build server does shed some light on the situation however...
[More]
Tags: TFS
8929563e-7117-416a-a390-03e1c1ee9ecf|0|.0
Overall I love the changes made to WF4. The latest workflow support is a huge leap forward from the 3.x versions. Unfortunately both versions suffer the same issues regarding feedback for the developer when exceptions are thrown. Consider the following simple workflow example. namespace WorkflowConsoleApplication1
{
using System;
using System.Activities;
class Program
{
static void Main(string[] args)
{
try
{
Workflow...
[More]
Tags: WF
65ab56ca-973b-424c-aa7e-cab39a04fe5d|2|5.0
Most people (myself included) assume that the Parallel and ParallelForEach<T> activities in WF4 run each child in parallel on multiple threads. Unfortunately this is not the case. Each child activity is scheduled in the workflow runtime at the same time. The child activities will only start running in “parallel” if one of the branches is in a waiting state. You can read this post which links to this post for some more detailed information You can achieve multi-threaded parallel execution ...
[More]
Tags: WF
01f8fb29-b388-4d4e-9ab5-1a0cdfcfd111|0|.0
My workplace has been having issues with VS2010 picking up old assemblies since we have been using VS2010 on a complex services solution. The issue usually pops up when executing test runs with the built in support for MSTest. This occasionally happened in VS2008 but is much more prevalent in 2010. The scenario seems to be that somewhere between the IDE and MSTest is picking up assemblies from prior TestResults directories if the assembly can’t be found in bin\Debug or bin\Release director...
[More]
Tags:
c9eb9e68-26ab-491a-be2c-6c5e9c6385c3|2|5.0
I recently posted a Unity extension for disposing build trees created by Resolve and BuildUp actions. Unity has a feature that supports lazy loading injected dependencies that the original disposal extension didn’t cater for. Consider the following example. using System;
using Microsoft.Practices.Unity;
using Neovolve.Toolkit.Unity;
namespace Neovolve.LazyInjectionTesting
{
class Program
{
static void Main(String[] args)
{
IUnityContainer containe...
[More]
Tags: Dependency Injection, Unity
b43f6069-7984-4fa2-b455-cbe4f65d87a3|0|.0
David Paquette posted last year about the performance characteristics of WF4. Runtime performance is a typical complaint with WF but it can be minimised as David has indicated. Adding some caching logic for workflow activity instances will avoid the expensive start-up process for invoking activities. Subsequent activity invocations will be much faster by getting the activity instance from the cache rather than creating a new one. I’ve put together an ActivityStore class that handles this cachin...
[More]
Tags: Performance, WF
8c32ccfd-d69b-448e-bd12-11bf8f3f305f|1|5.0
My recent post about creating proxies with RealProxy provided an example for creating a custom proxy implementation. Using proxies can provide a lot of power and flexibility to an application. Most of this code is common plumbing code that can be refactored out into some reusable classes. The ProxyHandler class below is the first of these reusable classes. It helps with creating RealProxy types by providing the common logic of method identification, exception processing and method response mana...
[More]
Tags: WCF
5624d07b-2d3a-45df-8b4b-9e69c5c4a295|0|.0
Yesterday I ran a couple of sessions at the Canberra .Net users group. I have attached a zip of the presentation deck and demo projects for you to have a look at in your own time.
Unity Injection With ASP.Net and
WCF.zip (1.45 mb)
Tags: WCF, ASP.Net, Unity
cb7bcf76-7a3c-4dec-825d-3b7902a2e7e1|0|.0