Archive for the ‘general’ Category

Pro WF for .NET 3.5

April 12, 2008

So my last post to this blog was back in November. I’ve been very busy working on an updated version of my Pro WF book. The new edition of my book was originally scheduled for availability in late July, but that date has now been moved up to June 23rd.

The new edition provides coverage of the new WF features in .NET 3.5 and includes two new chapters. One of the new chapters covers WF and WCF integration (workflow services). The other new chapter provides better coverage of building custom composite activities and handling long-running tasks. I’ve also reviewed and updated all of the example code, the text and the screen shots.

Visual Studio 2008 now available

November 20, 2007

After a long wait, Visual Studio 2008 (formerly known as Orcas) is now available. I’ve been using beta 2 for some time now and it’s been very stable. .NET 3.5 is also included with VS 2008. I’ll now have to find a spare day to uninstall the beta and install RTM.

Here are a few pertinent links:

http://msdn2.microsoft.com/en-us/vstudio/default.aspx

http://msdn2.microsoft.com/en-us/subscriptions/bb608344.aspx

http://www.microsoft.com/express/

Let the downloading begin!

.NET Framework Source Code to be released

October 3, 2007

Microsoft announced today that it will be releasing the source code for the .NET Framework in the VS 2008 time frame later this year.  No, it’s not going open source — instead it will be covered by something called the Microsoft Reference License.  The intent is to allow us lowly developers a peek into the inner workings of the framework for debugging purposes.

VS 2008 will also provide an integrated debugging environment where missing bits of source code are downloaded automatically.

Pro WF on sale at Bookpool

October 2, 2007

Bookpool.com has all Apress books on sale at 50% off list price. It’s a great time to pick up my Pro WF book if you don’t already have it. Since it’s also published by Apress, my .NET Interop recipes book is also on sale.

Activity Validation for Bound Properties

September 27, 2007

One of the readers (Andrew) of my Pro WF book recently had a question about page 114 of the book. This page contains the code for a custom activity validator class that enforces design-time requirements. In this example, I wanted to make sure that two properties of the target activity were set at design-time.

Andrew pointed out that the code only accepts statically set values for the properties. If you set these dependency properties by binding them to another property, the validation fails. He’s right. That particular example code only demonstrates how to validate against statically set values.

To solve the problem, all you need to do is call the IsBindingSet method of the base Activity class. Here is the revised code from page 114 (Listing 3-11) that now works for statically set or bound property values:

using System;
using System.Workflow.ComponentModel.Compiler;

namespace CustomActivityComponents
{
    /// <summary>
    /// Validator for MyCustomActivity
    /// </summary>
    public class MyCustomActivityValidator : ActivityValidator
    {
        public override ValidationErrorCollection Validate(
            ValidationManager manager, object obj)
        {
            ValidationErrorCollection errors = base.Validate(manager, obj);
            //only validate a single custom activity type
            if (obj is MyCustomActivity)
            {
                MyCustomActivity activity = obj as MyCustomActivity;
                //only do validation when the activity is in a workflow
                if (activity.Parent != null)
                {
                    if (activity.MyInt == 0)
                    {
                        if (!activity.IsBindingSet(MyCustomActivity.MyIntProperty))
                        {
                            errors.Add(
                                ValidationError.GetNotSetValidationError(
                                    “MyInt”));
                        }
                    }

                    if (activity.MyString == null ||
                        activity.MyString.Length == 0)
                    {
                        if (!activity.IsBindingSet(MyCustomActivity.MyStringProperty))
                        {
                            errors.Add(new ValidationError(
                                “MyString Property is incorrect”, 501));
                        }
                    }
                }
            }
            return errors;
        }
    }
}

CE 6.0 emulator not working with VS 2005

September 5, 2007

So, I’m starting to do a bit of embedded Windows development again. For this particular project, the target environment will probably be CE 6.0, so I went ahead and installed the CE 6.0 Platform Builder (eval) on my system.

My first goal was to make sure that I had a decent development environment, including a CE 6.0 emulator that I could use to test and debug my app from VS 2005. It looked like PB for CE 6.0 supported the creation of an SDK and that SDK could include an ARMV4I emulator. Great — that sounds like exactly what I needed. I quickly configured and built an OS image along with an SDK. Everything was looking good.

I installed the SDK and saw that my new CE device and emulator were available for selection within VS. Still looking good. I threw together a quick test app and hit F5 to start debugging. I selected my new emulator as the target device and waited. And waited. And waited. The emulator (version 2) started, but the OS wouldn’t deploy or boot — all I had was an emulator with a black screen and VS just sitting there hanging, trying to deploy the OS image.

Since I didn’t have much experience with this process, I figured I must be doing something wrong. Probably something very simple. After all, I was able to start the emulator and boot the image under Platform Builder, but not from my C# app in VS.

After about 2 days of researching the problem, it turns out that the KITL option in the CE 6.0 image was the problem. KITL is Kernel Independent Transport Layer and is used to debug CE devices. According to this post and a couple of others that I found, KITL and DMA (which is used by VS 2005 to communicate with a device) don’t mix very well. The solution is to turn off the “Enable KITL” option in my CE 6.0 image.

I rebuilt my image and SDK, reinstalled the SDK and tried again. This time the emulator booted up just fine, followed by my test app. Perhaps this is documented somewhere and I just missed it. In any case, thanks to Barry Bond at MS who posted this solution. He really hit one out of the park on this one (sorry).

Creating the circular reference

August 15, 2007

My colleague Larry Parker referenced this blog. So now I’ll complete the circle by referencing his.

Another reference

July 25, 2007

Oops…In my last post, I missed this reference to my Pro WF book:

http://spsfactory.blogspot.com/2007/07/bruces-fantastic-pro-wf-windows.html

Maybe there are others out there that I just haven’t found yet.  If you’ve referenced my book on your blog or site, I’d love to know about it.

A quick search

July 21, 2007

Ode to Solution Explorer expand and collapse

July 12, 2007

I’ve been using various versions of Visual Studio for a very, very long time. As each new version is released by Microsoft, I look in vain for the one feature that I really want. I want the ability to expand or collapse all projects within the Solution Explorer! Some of my solutions contain 100 or so individual projects. Do you know what a pain it is to manually collapse 100 projects individually? Why is it so difficult to implement this seemingly simple feature? Maybe I’m the only one who would like this, but I think not.