November 2007 - Posts

If you are using Visual Studio 2008 in combination with Visual SourceSafe (VSS) you might be experiencing some problems. These are because the updated VS2008 support for VSS didn't ship with VS2008 as it was supposed to. There is however a CTP with the VS2008/VSS integration you can download that should fix the problems for now.

 

More details and a link to the CTP download here: http://blogs.msdn.com/richardb/archive/2007/11/19/vs-2008-users-remember-to-download-the-sourcesafe-ctp.aspx

 

Enjoy!

with 2 comment(s)
Filed under: , ,

Last week during my Workflow Foundation presentation I was asked a question about using a custom root activity with pure XOML workflows. This is always a bit of a drag to get working, especially because you need to do two things, one for the designer and the other for the runtime.

Let's start with the following setup.
Solution
WorkflowConsoleApplication4
ActualWorkflow.xoml
WorkflowLibrary4
BaseWorkflow.cs

The BaseWorkflow.cs contains the class BaseWorkflow that is derived from SequentialWorkflowActivity and is the base class we want to use for our ActualWorkflow.xoml.

namespace WorkflowLibrary4

{

public sealed partial class BaseWorkflow : SequentialWorkflowActivity

{

// The actual code

}

}

 

Next we need to add the following to the AssemblyInfo.cs in the WorkflowLibrary4 project:
[assembly: XmlnsDefinition("urn:WorkflowLibrary4", "WorkflowLibrary4")]

 

This associates the schema urn:WorkflowLibrary4 with the assembly and is needed by the workflow designer.

Next add a project reference to WorkflowLibrary4 from WorkflowConsoleApplication4.

Next we need to create the workflow with the same namespace declaration:

<ns0:BaseWorkflow x:Name="ActualWorkflow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/workflow" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ns0="urn:WorkflowLibrary4">

    <!-- Add the remainder of the workflow here. -->

</ns0:BaseWorkflow>

The important part is the xmlns:ns0="urn:WorkflowLibrary4"> declaration and the <ns0:BaseWorkflow root element.

Rebuild and you should be able to double click on the xoml file and open it in the workflow designer. Go ahead and add any extra activities.

 

So far so good but now we need to run it.

In order for the WorkflowRuntime to know about the BaseWorkflow type we need to add a TypeProvider runtime service. Add the following to the Program.cs:

TypeProvider typeProvider = new TypeProvider(null);

typeProvider.AddAssembly(Assembly.GetAssembly(typeof(BaseWorkflow)));

workflowRuntime.AddService(typeProvider);

 

Next we are ready to load the workflow definition and start one this way:

try

{

XmlReader reader = XmlReader.Create("ActualWorkflow.xoml");

XmlReader rules = XmlReader.Create("ActualWorkflow.rules");

WorkflowInstance instance = workflowRuntime.CreateWorkflow(reader, rules, null);

instance.Start();

 

waitHandle.WaitOne();

}

catch (WorkflowValidationFailedException ex)

{

// Display load/validation errors

foreach (ValidationError error in ex.Errors)

Console.WriteLine(error.ErrorText);

}

 

In this example I used a declarative rule so there is an additional rules file. Another tidbit is the exception of type WorkflowValidationFailedException that is raised if something is wrong when loading the workflow. The Errors collection will provide the details of what is wrong. The most often seen error in a case like this is the error that some object could not be deserialized. If this happens in the designer first rebuild the solution and if the error persists make sure the namespace in the AssemblyInfo.cs and the ActualWorkflow.xoml actually match up. If the same error occurs at runtime also check if there is a TypeProvider with the assembly in question added to the workflow runtime.

Enjoy!

with 3 comment(s)
Filed under: , , ,

If you came to my DotNed talk on Workflow Foundation last Thursday at Macaw you can find the downloads for the PowerPoint sheets and samples below. For those who didn't attend, feel free to download them but keep in mind that the sheets are in Dutch.

For the first session: Intro into Workflow Foundation download this file.

For the second session: Developing custom activities download this file.

Enjoy and let me know if you have any questions.

with no comments
Filed under: , ,

Next Thursday I will be doing a talk for the Dutch DotNed user group hosted by Macaw.

During this Dutch language session I will show you all the ins and outs of developing custom activities for use with Workflow Foundation. And for those not quite that well versed in WF there will be an intro into why one should want to use WF in the first place.

There are just a few seats left so hurry up go the DotNed site to register if you want to go!

Hope to see you there.

with no comments
Filed under: , , ,

If you have an MSDN subscription you can download the released version of Visual Studio 2008. Great news, especially considering it isn't even 2008 yet. I guess software isn't late all the time Smile

Great job for all the Microsofties involved and thank for all the hard work!

Check out http://msdn.microsoft.com/subscriptions for the download pages.

with no comments
Filed under: , ,

The last day of TechEd and my feet appreciate the fact Sad All the standing around took its toll and I guess I should have brought different shoes. O well a good thing to remember for next year.

Saw some more interesting sessions this morning. I started off with a session from György Balássy about using workflow foundation with ASP.NET applications. He did a pretty good job of showing what works and what doesn't or where you need to tweak the defaults.

This afternoon there were a couple sessions about VB and the future for VB developers. These where quite interesting and showed some of the stuff coming in VB9 with Visual Studio 2008 later this month. One thing I never realized was that just including an XML schema in a project is enough for IntelliSense to use it. No need to do any extra configuration.

Right now I am watching the last session, also about VB but a Q&A session by Amanda Silver and Jay Schmelzer. Not a prepared session but basically the audience determines what is discussed. The suggested topics include quite a bit about VB6 and .NET interop, I guess there are still an awful lot of VB6 developers out there that haven't made the switch to .NET yet. Another topic that I wasn't really expecting here was VBA and the possibility of a VBA.NET but I guess the future isn't very clear there. I would expect to see very few changes to the current status quo there.

So the bog speculation is where TechEd will be held next year. I heard rumors about all sort of places like Amsterdam, Copenhagen and even Istanbul. I guess I would lke the last as I think Istanbul is a great and very interesting city.

with no comments
Filed under: , , ,

Just another day at the office called TechEd Smile

Today was another good day. Some very interesting sessions to watch and unfortunately some not so good as well.

On the good side I heard Justin Smith give a deep dive presentation about WCF and he did an excellent job explaining the internals. I am not sure I will remember every one of the small differences between communication channels he explained but at the very least I know who to ask Smile. Another excellent session was by Daniel Moth about developing applications for Windows Vista. Vista may not be the most popular version of Windows yet but the fact is that it will continue to grow, whether we like it or not.

Unfortunately there are some sessions that are not quite as good. I just listened to Goksin Bakir but did not like the session at all. First of all he didn't really explain the point of what he was doing and secondly his coding was very sloppy making for a very boring session.

I also ran into Amanda Silver and Jay Schmelzer from the VB team in Redmond today. Its always nice to meet them and exchange ideas. Recently there have been a lot of discussions about the future of Visual Basic and I couldn't resist letting them know my position, as if they didn't know yet.

More tomorrow!

with no comments
Filed under: , , ,

So another day at TechEd Barcelona. Not all that much to report though. I had booth duty at the Ask The Experts booth all day so didn't get to see any sessions yet. The booth was pretty quiet with not to many questions, so not much to report there. Now I am waiting for the last session slot of the day. I am going to What is new in WPF 3.5 by Ian Griffiths. I don't think I have heard him before so I am just as interested in the speaker as the topic.

This evening we are getting together for the MVP dinner, which is always good fun Smile

with no comments
Filed under: , , , ,

So TechEd Barcelona has started.

Soma Somasegar did the keynote. No big surprises there and no real big announcements either. He did day that Visual Studio 2008 would be RTMed before the end of the month. Not the big news a lot where hopping for, i.e. that it was released today, but still some very welcome news.

I am in the forst session now. Or more accurately my second as I walked out of the first as the speakers accent was rather difficult to follow. Too bad because I am sure it would have been an nteresting session showing WPF collaboration between a developer and a designer. But the accent… So now I am listening to a VSTO session, and the new V3 features.

Speaking of VSTO I will be working the VSTO booth in the Ask The Expert stand later today and all tomorrow. So you all had better come up with some interesting questions Smile

More to follow as it happens.

with no comments
Filed under: , ,

Then take a look at Rocky Lhotka and Anthony Handley presentation from MIX. Even though the title suggests they also show a lot of Silverlight stuff they don't. But they do explain why not Smile

Links to the recordings can be found here.

Enjoy!

with no comments
Filed under: , , ,