The mysteries of software development and networking... RSS 2.0



 Saturday, August 30, 2008

According to Matt Winkle some performance enhancements have been made to the Workflow designer in Visual Studio 2008 SP1. Strangely enough no mention of these improvements is made in the release notes. I wonder if they made it in.

Matt Winkle: "In .NET 3.5 SP1, there are no features introduced, but there have been a number of internal improvements made, including some substantial perf gains in the WF designer (for certain scenarios)."

Saturday, August 30, 2008 8:37:17 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WF
 Friday, August 29, 2008

Windows Workflow scheduling services manage how workflow instances are scheduled by the workflow runtime engine. Whether they are handled in an asynchronous manner through the DefaultWorkflowSchedulerService, or in a manual, synchronous manner through the ManualWorkflowSchedulerService, these services are an important part of your workflow solution.

The application I'm working on right now uses ManualWorkflowScheduler, so I needed to figure out the exact differences between the two scheduler, luckily MSDN actually offers pretty clear documentation:

Default Workflow Scheduler Service

DefaultWorkflowSchedulerService is used by the workflow runtime engine by default. It creates and manages the threads that run workflow instances in an asynchronous manner on the workflow runtime engine. Workflows that are waiting to run are stored in the internal queue of the DefaultWorkflowSchedulerService . When the DefaultWorkflowSchedulerService wants to start a workflow, a thread is acquired from the .NET Framework thread pool and used to run the workflow. The MaxSimultaneousWorkflows property determines how many simultaneous threads the scheduler service will allow at one time. If the limit is four, for example, the DefaultWorkflowSchedulerService will acquire up to four threads from the .NET Framework thread pool to execute the workflows. If four workflows are already running, additional work items (workflows) are placed in the queue and eventually executed as threads become available. The following figure shows how the DefaultWorkflowSchedulerService executes workflows in an asynchronous manner.

defaultworkflowscheduler

You can set the maximum number of workflow instances that can be active at any one time by passing a parameter to the DefaultWorkflowSchedulerService constructor or by using an application configuration file. Task 1: Configure Runtime Services Using Code shows how to configure the DefaultWorkflowSchedulerService class by using the constructor. Task 2: Configure Runtime Services using App.Config shows the same configuration of the DefaultWorkflowSchedulerService but uses an application configuration file.

Manual Workflow Scheduler Service

The ManualWorkflowSchedulerService provides a threading service that enables the host application that creates a workflow instance to donate the Thread on which the workflow instance is run. Using this threading service, host applications can run a workflow instance on a single Thread (that is, in synchronous mode). This mode blocks the execution of the host application until the workflow instance becomes idle. Subsequently, the workflow instance can only be executed by using the RunWorkflow method of this service.

Alternatively, the workflow can be run on a thread created by a .NET timer by setting the useActiveTimers constructor parameter to true. When this timer expires, the workflow is executed on the timer's thread, rather than the host application's thread. This timer is implemented as a DelayActivity activity.

ManualWorkflowSchedulerService controls the number of threads spawned in an ASP.NET process by reusing the thread that made the ASP.NET Web request to run the workflow instance. This ensures that at any time, the number of active threads in the workflow runtime equals the number of active Web requests in the ASP.NET process.

ManualWorkflowSchedulerService does not automatically run a workflow instance that is in the queue. The host must call RunWorkflow to run a specified workflow.

Friday, August 29, 2008 4:49:56 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WF

The workflow designer in VS2008 can sometimes be a little sluggish. I ran across a post on the forum which offers the following advice:

Commonly reported issues

1. Time taken to open a workflow document is long.

2. Opening Activity bind dialog is slow.

Reasons for slow down

The Workflow designer relies on parsing the source code in the current project to provide updated design information in workflow design surface, rules dialog intellisense etc. This is mainly to enable scenarios where picking up changes from the source even before the project has been rebuilt.

Tips to make designer perform better

1. Move all types used in workflows to a different project than where the workflows live.

Move interfaces, event types, custom activities, helper classes to a different project than in which the workflow resides. E.g. in the solution from a customer, there were about 10 project, with 10 workflows each and 10 associated event types. These types are all reparsed to update to build the design time type information every time the user changes workflows in the project. Moving these to a different assembly e.g  just one project with all the types needed for the 10 workflow projects will help improve performance.

2. Reduce the number of workflows in a project.

Each workflow is a type ( directly in c#/vb, and indirectly in xoml case) that needs a design time type to be built by parsing, so if there are 10 workfows in a project, opening any workflow in the project for the first time means parsing all the other workflows as well. Classifying these workflows based on their function and grouping them in 2-3 workflows per project improved performance drastically.

3. Re-Factor large state machine workflows into smaller workflows

One example we found from a customer had 780 states and 1000 activity binds in the same workflow, leading to a InitializeComponent() of about 16000 lines. Factoring this state machine into smaller reusable workflows will making designer performance much better, and reduce a lot of redundant states.

4. Don’t do long running work in activity constructors

Activity constructors are called during design time also, so doing things like connecting to a database etc should never be done in constructors, this can make the designer take too long to open workflow documents using these activities.

Friday, August 29, 2008 4:28:45 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WF

Visual Studio 2008 SP1 and .NET 3.5 SP1 offer an extensive list of enhancements, but also of bug fixes, here are the links in case (like me) your looking for a specific fix:

http://support.microsoft.com/kb/950263/ - List of changes and fixed issues in Visual Studio 2008 Service Pack 1

http://support.microsoft.com/kb/951845/ - List of changes and fixed issues in Visual Studio 2008 Service Pack 1 for Team Editions 

http://support.microsoft.com/kb/950264/ - List of changes and fixed issues in Visual Studio 2008 Service Pack 1 for Express Editions

http://support.microsoft.com/kb/951847/ - List of changes and fixed issues in Visual Studio 2008 Service Pack 1 for the .NET Framework 3.5

Friday, August 29, 2008 4:13:24 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
.NET | Team System
 Wednesday, August 27, 2008


Thanks to Derek.
Wednesday, August 27, 2008 12:41:55 AM (Eastern Standard Time, UTC-05:00)  #    Comments [49] -
General
 Friday, August 22, 2008

The article wrote for Code Magazine, named 'From Delegate to Lambda', about understanding the transition from delegates to lambdas has been published in the September issue and can also be found online at: http://www.code-magazine.com/Article.aspx?quickid=0809081.

Friday, August 22, 2008 12:26:32 AM (Eastern Standard Time, UTC-05:00)  #    Comments [4] -
C#
 Monday, August 11, 2008

The annual geekfest, the Software Development Network Conference 2008 is being held on the 6th and 7th of October at the Leeuwenhorst in Noordwijkerhout (close to Amsterdam).

The list of speakers and sessions has been published and the Early Bird discount applies until August 16th. So sign up now.

Monday, August 11, 2008 5:30:29 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General

After last years success, three user groups in the Netherlands are again coordinating their efforts to create the 2nd Dutch Code Camp.

Interested in speaking or attending? Sign up here.

Monday, August 11, 2008 5:25:21 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General

Chris Bowen and and a group of volunteers is putting together the TENTH Boston Code Camp. Call for speakers is out right now. So go ahead and volunteer to speak at this great event!

Monday, August 11, 2008 5:22:40 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General

Tomorrow night I'll be the guest speaker at the BAND (Bangor Area .NET Developers user group). I'll be talking about Workflow Foundation.

Workflow Foundation (WF) is one of the pilars of .NET 3. If you think WF is an end user tool then you’re wrong. It is a framework targeted at software developers that want to embed workflow into their custom applications. This session will explore the WF basics and focus on implementing State Machine Workflows, how to use the workflow runtime and where Windows Communication Foundation fits in the whole picture.

Sign up here.

Monday, August 11, 2008 5:18:14 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
WF
 Sunday, August 03, 2008

I use a VirtualPC environment for all my software development work, usually using a unique environment for every customer. This eats up the drive space in my laptop pretty darn quick. So after reading about running a VirtualPC image from a USB Flash Drive I decided to give it a try. I purchased a 32GB memory stick and plugged it in.

After a little experimenting I can now confirm it runs the VirtualPC nice and fast. But writing data to the disk and reading at the same time is horrendously slow. So you need to do two things:

a) Make sure the .vmc file is NOT located on the flash drive
b) Enable UndoDisks

These two steps will create a temporary file on your harddisk, in the folder where the .vmc is located. This means that while using the drive you only read from the flash drive, but never write.

When you shut down the VPC you can choose to commit the changes to the flash drive, this may take a little while, so only do it when you have time to wait for it to complete.
I usually choose 'Save State' which allows me to restart the VPC where I left off.

Sunday, August 03, 2008 4:53:47 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Friday, August 01, 2008

If you're using the xsd.exe tool to generate C# code from an XML Schema you'll find that an attribute defined as an integer is generated into a string field.

The reason is listed on MSDN:

The xs:integer type is specified as a number with no upper or lower bound on its size. For this reason, neither XML serialization nor validation map it to the System.Int32 type. Instead, XML serialization maps the xs:integer to a string while validation maps it to the Decimal type that is much larger than any of the integer types in the .NET Framework.

Friday, August 01, 2008 6:52:45 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
C#
 Wednesday, July 30, 2008

Ted Neward offers a very good description of what a Software Architect is:

"an architect is not like a construction architect, but more like the conductor of a band or symphony. Yes, the band could play without him, but at the end of the day, the band plays better with one guy coordinating the whole thing. The larger the band, the more necessary a conductor becomes. Sometimes the conductor is the same thing as the composer (and perhaps that's the most accurate analogous way to view this), in which case it's his "vision" of how the music in his head should come out in real life, and his job is to lead the performers into contributing towards that vision. Each performer has their own skills, freedom to interpret, and so on, but within the larger vision of the work."

Wednesday, July 30, 2008 12:27:14 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Architecture
 Wednesday, June 11, 2008

My article on combining AIM Call Out with geocoding a phone number to display the location of the person you're trying to call has gone live on the AOL Developer Network.

I think it turned into a very cool sample application.

Dial a number and see the location of the person you're calling!

Wednesday, June 11, 2008 10:56:10 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
.NET | AOL | C#
 Tuesday, June 10, 2008

It seems there is some controversy (1) (2) around whether Live Mesh is good or bad. Here is my 2 cents: I've installed Live Mesh Tech Preview about a month ago and am pretty impressed by it so far. It seems to me Microsoft may have found the tool that will unify the desktop (where they make their money) with the cloud (revenue?). Currently there are two features that I use and like:

a) Sync files automatically with all machines in my Live Mesh group of devices
b) If my Live Mesh device is on, then I can use Remote Desktop Connection (or a Live Mesh version thereof) to remotely connect to that device. Even if it is behind a firewall and on a dynamic IP DSL connection. This is great because my machines at the office are connected to the Internet via a dynamic IP connection and now I can just connect to them, by clicking them via the Live Mesh icon in my icon tray.

The sync files feature will be further improved in the future when Peer 2 Peer synchronization will be supported. I suggested this feature on MS Connect, but it was already planned :-)
Here is the response I got:

We plan to include selectable direct Peer to Peer (P2P) as a sync scenario in a later milestone, which is in effect what you have asked for here I believe.
Thank you for this report!
Tim

I use a lot of Virtual PC images. I'm hoping I can use this P2P sync service to create continuous backups (don't know if the bandwidth needed will prove to be a killer).

What is interesting is that files on Live Mesh will sync, even if the user is not signed in. This means that on the client Live Mesh is connected to the cloud without a user logging on. This offers potential for an interesting feature like 'Live Mesh Lockdown'. Suppose my machine is stolen. I could use some other device, go to the Live Mesh Desktop on the web and mark the device as stolen. This could lead to the machine being locked for further use. I have no idea what information is stored on the server with regards to the device. Perhaps this feature could even become part of the next version of Windows. That way if the thief re-installs the machine the server can still recognize the device (based on MAC address?) and still lock the machine.

Anyway, can't wait to see what the developer API for Live Mesh looks like.

Tuesday, June 10, 2008 1:31:26 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Thursday, May 29, 2008

The Software Developer Network user group will be hosting it's quarterly event on Monday, June 23. The theme of the event will be Collaboration, but plenty of general topic sessions will be held as well (a total of 30 sessions!).

Go to www.sdn.nl/sde to sign up.

Here is an overview of the sessions:

.Net C#

.Net VB
DotNetNuke
Inform. Worker
Delphi
User eXperience
8:30
Registratie / Ontvangst
9:00
General session
Softwarekwaliteit, wat is dat eigenlijk?

Jaap van Ekris

Addressing non-functional requirements with aspects

Gael Fraiteur

DotNetNuke Development: meer dan modules

Stefan Kamphuis

SharePoint 2007 en WWF: Integratie van Divergerende Werelden

Gustavo Velez

VCL for the Web

Hadi Hariri

User Experience op het web

Robert Kuunders
10:15
Pauze - 30 min.
10:45
General session
Waarom agile wel werkt en waterval niet

Sander Hoogendoorn

SharePoint filter webparts - theorie en praktijk

Ton Stegeman

Dynamic Localization in DotNetNuke

Peter Donker

Samenwerken, met Groove een fluitje van een cent!

Dennis Vroegop

Continuous Integration in .NET

Hadi Hariri

Adobe Flex en AIR : De kracht van Rich Internet Applications

Christoph Rooms

12:00
Lunch - 60 min.
13:00

.NET en hardware - video capture en servo's aansturen

Jeroen W. Pluimers

Towards more complex aspects using PostSharp

Gael Fraiteur

Synching your dev and live environments

Erik van Ballegoij

Gepersonaliseerd nieuws op basis van MOSS 2007 Search

Mike Fortgens & Mirjam van Olst

Unicode in Delphi for Win32

Bob Swart

Silverlight2

Robertjan Tuit

14:15
Pauze - 15 min.
14:30

Microsoft Sync Framework in action

Dennis van der Stelt

Het gebruik van een Object Relational Mapper tool

Diderick Oerlemans

DotNetNuke Schedular Interface

Leigh Pointer

Bouw een Silverlight smoelenboek in SharePoint

Donald Hessing & Reinhard Brongers

Practical Delphi WOA

Paweł Głowacki

Interaction Design: What the user really wants

Stefan Bookholt

15:45
Pauze - 30 min.
16:15

Peer-to-peer en collaboration met .NET 3.5

Alex Thissen

Customize VSTS WorkItems within your application

Mike Glaser

Content Syndication met DotNetNuke

Peter Donker

Collaboration met Lotus Quickr en Microsoft SharePoint

Arjan Uijl &
Ton Stegeman

Delphi en het Clipboard - copy en paste meer dan tekst alleen

Jeroen W. Pluimers

Developers + Designers = User Experience

Martion Tirion

17:30
Einde
Thursday, May 29, 2008 12:01:04 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
General
 Wednesday, May 21, 2008

Anyone familiar with building applications using .NET Remoting (in .NET 2.0) knows that the DataSet and DataTable classes have a property called RemotingFormat. This could be set to either XML or Binary where Binary would give you a performance boost since it is more compact.

Windows Communication Foundation does not use this property at all. The service binding dictates the serialization format, no matter what you set the RemotingFormat property to be, even if your using a NetHttpBinding.

The following configuration will setup a service to use .NET Binary formatting over Http:

<system.serviceModel>
  <bindings>
    <customBinding>
      <binding name="NetHttpBinding">
        <reliableSession />
        <compositeDuplex />
        <oneWay  />
        <binaryMessageEncoding  />
        <httpTransport />
      </binding>
    </customBinding>
  </bindings>
  <services>
    <service behaviorConfiguration="ServiceBehavior" name="MyService">
      <endpoint address="" binding="customBinding"
        bindingConfiguration="NetHttpBinding" name="HttpBinding" contract="IService" />
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="ServiceBehavior">
        <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
        <serviceMetadata httpGetEnabled="true"/>
        <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
        <serviceDebug includeExceptionDetailInFaults="false"/>
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

So even if your service looks something like this:

public DataSet GetData()
{
    DataSet ds = BuildDataSet();   // retrieve some data here
    ds.RemotingFormat = SerializationFormat.Xml;
    return ds;
}

The DataSet will still get serialized as a .NET binary as defined in the binding ('binaryMessageEncoding').

Wednesday, May 21, 2008 4:04:18 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
C# | WCF
 Tuesday, May 13, 2008

The article I wrote about building a Voice over IP .NET application using AIM Call Out and the AOL Open Voice API has just gone live on the AOL Developer Network. Read it here.

Tuesday, May 13, 2008 2:11:26 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
.NET | AOL | C#

A lot is being blogged about the availability of VS 2008 SP1 and TFS SP1. It contains fixes and many new features and sound almost too good to be true, but I checked, it's not an April fool's joke :-)

A little lost in the noise about new features is the fact that .NET Framework 3.5 SP1 will include .NET CLR 2.0 SP2. I've been unable to find anything about this other than this one post by Eric Eilebrecht, but any CLR update is significant.

Tuesday, May 13, 2008 8:07:59 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
.NET
 Saturday, May 10, 2008

I just wasted some of my time figuring out how to do collection initialization in VB9.

C#3.0 has a new feature called collection initializer and according to a (somewhat older) post by Scott Guthrie, VB9 was slated to have it too. I guess it got cut somewhere.

Anyway this is what collection initializers look like in C#3.0:

List<int> numbers = new List<int> { 1, 2, 3, 4, 5 };

The closest thing in VB9 would be to use array initializers:

Dim numbers As New List(Of Integer)

Dim temp() As Integer = {1, 2, 3, 4, 5}

numbers.AddRange(temp)

Saturday, May 10, 2008 9:22:46 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
C# | VB.NET
About
This blog is run by Mark Blomsma.
© Copyright 2008
Develop-One
Sign In
Statistics
Total Posts: 337
This Year: 81
This Month: 0
This Week: 1
Comments: 94
All Content © 2008, Develop-One
DasBlog theme 'Business' created by Christoph De Baene (delarou)