Get your blog to speak up!

By clicking the    icon above you can have the content of the blog post to be read back to you. Not a very useful feature perhaps, but I thought it was pretty cool. The feature is provided by ReadSpeaker and is easy to implement.

First, register you on the ReadSpeaker site. The advertisement version is free but can only be used for personal websites and bloggers.

Secondly, add the script tag below in the head of your page. I’m using Community Server, so I added it to the theme masterpage.

<script 
    language="javascript" 
    type="text/javascript" 
    src="http://wr.readspeaker.com/webreader/webreader.js.php?cid=[PrivateKey]">
</script>

Then, on your page add the img tag below:

<img onclick="readpage(this.id+escape(document.location.href),1); return false;"
src="http://blogical.se/blogs/mikael/loudspeaker.png" 
id="http://wr.readspeaker.com/webreader/webreader.php?cid=[PrivateKey]&amp;t=blog_free&amp;title=readspeaker&amp;url="
title="Listen with webReader" 
alt="Listen with webReader"/>

If you want to limit the text to be read you can use the comments below:

<!-- RSPEAK_START -->
<p>
    Blog post....</p>
</p>
<!-- RSPEAK_STOP -->

btw, it’s not optimized for reading code, as you might have already found out 😉

Consolidating BizTalk blogs

 


In the past, the product team has been blogging about BizTalk in multiple blogs:


 
















BizTalk Engine


http://blogs.msdn.com/biztalk_core_engine/


Adapters


http://blogs.msdn.com/adapters/


B2B/EDI


http://blogs.msdn.com/BizTalkB2B/


RFID


http://blogs.msdn.com/biztalkrfid/


 


Over time, some of these have become silent and others are updated from time to time. We’ve also heard that it is confusing to look for related information in multiple places. To solve this, we’re going to consolidate all BizTalk product team blogging into this blog: http://blogs.msdn.com/biztalk_server_team_blog/


 


We’ll try to make our blogging more interactive – we’ll respond to comments on articles and ask for your input on features you use and topics you want to hear. We’ll periodically post articles, so keep in touch.


 


Ciao


BizTalk Server Team

Intellisense Crashing fix for VS 2010

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

We shipped the VS 2010 RC on Monday, and have seen some great feedback regarding performance and stability with it.

One issue, though, that we have seen a number of people run into is an intellisense crash that happens very frequently on machines that have UI Automation enabled and certain devices connected.

Crash Symptom

If you are encountering frequent VS 2010 crashes when you are typing in the editor while Intellisense is popping up and/or being dismissed then you are running into this issue.

Why does the crash happen?

The most common cause of the crash happening is that you are running a machine that:

  • Is a Tablet PC (even if you aren’t using the pen)
  • Has multi-touch screen drivers enabled
  • Has an external input device like a pen or Wacom tablet
  • Has a screen-reader enabled

It turns out that a late fix right before the RC shipped modified a UI input code path that unfortunately exposed this bug.

A patch is coming to fix this issue

We are working on shipping a VS 2010 RC patch that we’ll release next week that will fix the issue and prevent it from occurring.  I’ll blog a pointer to the patch once it is available.

How to work around the issue now

There are two ways you can work around the issue now.  One is to disable your Tablet services (read this article for details on how to do this) and/or disable Multi-touch/Pen drivers on your system.  The other is to set a registry key.

You can read about both of these workaround in this VS Team Blog Post.

What if you still see crashes?

Please send me email ([email protected]) if you are still seeing any crashes after trying out these steps (or encounter crashes for non-Intellisense scenarios) – we’d like to make sure we investigate and follow-up any others you encounter.

Hope this helps,

Scott

BizTalk Virtual Training Material

BizTalk Virtual Training Material

Hi folks,

Lately I’ve had several requests from folks whom want to have a play with BizTalk
but don’t want to setup the whole infrastructure etc.

Here’s a great page from MS Virtual Labs that will get you on your way
(some labs are for BTS2006, others for BTS2009, the same principles apply)

Check it out and if you’re ever away from a VM, might be handy a fallback plan.

BizTalk
Virtual Lab Material

There’s 4 pages and here’s a snippet from Page 1

————————————————————–

Click here to bookmark this event.
After completing this lab, you will be
better able to create a new BizTalk project, create an XML schema by using the BizTalk
Editor, promote a schema property, create a flat file schema by using the BizTalk
Editor, validate a schema and generate a sample instance
message, create a strong name and assign it to an assembly, and build a schema project.
 …
4/3/2006 12:00 AM Pacific Time
(US & Canada)- 9/30/2011 11:59 PM | Duration:90 Minutes
Primary Language:   English
Primary Target Audience:   Pro
Dev/Programmer
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032296903&culture=en-US

Click here to bookmark this event.
After completing this lab, you will be
better able to create a schema map by using BizTalk Mapper, add functoids to a map,
validate a map, and build a schema map project.
4/3/2006 12:00 AM Pacific Time
(US & Canada)- 11/30/2010 11:59 PM | Duration:90 Minutes
Primary Language:   English
Primary Target Audience:   Pro
Dev/Programmer
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032296906&culture=en-US

Click here to bookmark this event.
After completing this lab, you will be
better able to define business rules, call business rules from within an orchestration,
build and deploy the business rules project, and start and test the business rules.
5/7/2008 12:00 AM Pacific Time
(US & Canada)- 5/31/2011 11:59 PM | Duration:90 Minutes
Primary Language:   English
Primary Target Audience:   Pro
Dev/Programmer
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032379047&culture=en-US

Click here to bookmark this event.
After completing this lab, you will be
better able to assign an application name to a BizTalk Server project, use the BizTalk
Server 2006 Administration Console to create receive ports, receive locations, use
the BizTalk Server 2006 Administration Console to import
port binding information, bind orchestration ports to physical ports, export a BizTalk
application to an MSI package, import a BizTalk application from an MSI package, and
finally, use the Group Hub to manage suspended messages.
 …
4/3/2006 12:00 AM Pacific Time
(US & Canada)- 12/31/2010 11:59 PM | Duration:90 Minutes
Primary Language:   English
Primary Target Audience:   Pro
Dev/Programmer
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032296904&culture=en-US

Click here to bookmark this event.
After completing this lab, you will be
better able to educate attendees on integrating Commerce Server 2007 with ERP or CRM
systems and external business trading partners by utilizing the new built-in integration
adapter for BizTalk Server 2006. Also, you will learn
how to utilize the new Orders, Inventory, Catalog, and Profile BizTalk Adapters in
detail to achieve high-performing, reliable connectivity between Commerce Server
deployments and other external systems.
 …
4/20/2007 12:00 AM Pacific
Time (US & Canada)- 8/31/2010 11:59 PM | Duration:90 Minutes
Primary Language:   English
Primary Target Audience:   Pro
Dev/Programmer
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032338959&culture=en-US

Click here to bookmark this event.
After completing this lab, you will be
better able to define business rules, call business rules from within an orchestration,
build and deploy the business rules project, and start and test the business rules.NoteBy
registering for this virtual lab, you will receive a
one-time follow up call from a Microsoft representative to inform you of special discounts
and offers related to products and services presented in the virtual lab.
 …
4/3/2006 12:00 AM Pacific Time
(US & Canada)- 11/30/2010 11:59 PM | Duration:90 Minutes
Primary Language:   English
Primary Target Audience:   IT
Generalist
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032313534&culture=en-US

Click here to bookmark this event.
After completing this lab, you will be
able to create a new BizTalk project, create an XML schema by using BizTalk Schema
Editor, promote a schema property, create a file schema by using BizTalk Schema
Editor, validate a schema and generate a sample instance
message, and build a schema project.
 …
12/7/2005 12:00 AM Pacific
Time (US & Canada)- 7/31/2010 11:59 PM | Duration:90 Minutes
Primary Language:   English
Primary Target Audience:   Pro
Dev/Programmer
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032279924&culture=en-US

Click here to bookmark this event.
After completing this lab, you will be
able to configure orchestration properties, create the orchestration to be published,
build and deploy the orchestration publishing project, run the BizTalk Web Services
Publishing Wizard, and start and test the published orchestration.  …
10/24/2005 12:00 AM Pacific
Time (US & Canada)- 2/28/2011 11:59 PM | Duration:90 Minutes
Primary Language:   English
Primary Target Audience:   Pro
Dev/Programmer
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032303224&culture=en-US

Click here to bookmark this event.
After completing this lab, you will be
able to add a Web reference to a project, create a map, create variables for message
instances, create the Web services orchestration, and build and deploy the Web
services project.
10/24/2005 12:00 AM Pacific
Time (US & Canada)- 1/31/2011 11:59 PM | Duration:90 Minutes
Primary Language:   English
Primary Target Audience:   Pro
Dev/Programmer
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032303223&culture=en-US

Click here to bookmark this event.
After completing this lab, you will be
better able to assign an application name to a BizTalk Server project, use the BizTalk
Server 2006 Administration Console to create receive ports, receive locations, use
the BizTalk Server 2006 Administration Console to import
port binding information, bind orchestration ports to physical ports, export a BizTalk
application to an MSI package, import a BizTalk application from an MSI package, and
finally, use the Group Hub to manage suspended messages. NoteBy registering for this
virtual lab, you will receive a one-time follow up call from a Microsoft representative
to inform you of special discounts and offers related to products and services presented
in the virtual lab.
 …
2/3/2006 12:00 AM Pacific
Time (US & Canada)- 9/30/2010 11:59 PM | Duration:90 Minutes
Primary Language:   English
Primary Target Audience:   IT
Generalist
http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032296907&culture=en-US

Two New Webcasts from Brian Loesgen

Brian has been busy looking at the integration capabilities of BizTalk, the ESB Toolkit 2.0 and the Windows Azure service bus. There are two webcasts looking at different aspects of this:
Extending the Reach: Using a BizTalk Dynamic Send port to send to Windows Azure platform AppFabric Service Bus
Extending the Reach: Using a BizTalk ESB Off-ramp to send to Windows Azure platform AppFabric Service Bus

LIDNUG Online Chat with Me on Thursday Feb 11th

Today we opened up the VS 2010 RC for everyone to download.  You can download it here.  Jason Zander (who runs the Visual Studio team) has a good blog post that summarizes a lot of common questions about it here.

As I mentioned in my blog post about the RC on Monday, please send me email ([email protected]) about any bugs or issues you encounter – that way I can make sure to connect you with someone who can follow up and investigate them quickly.

Online Chat with Me Thursday February 11th at 10am PST

I’m doing a virtual webcast chat Thursday February 11th from 10am to 11:30am (PST timezone).  The chat is open to everyone and sponsored by the LIDNUG user group.  The format of the chat is open – and you can ask anything while you listen in as I try and answer as many questions as possible.  I expect I’ll spend a lot of time talking about VS 2010, .NET 4, Silverlight 4, ASP.NET 4 and ASP.NET MVC 2.

You can register and attend the chat for free here.

Hope this helps,

Scott

WF4 runtime performance

Welcome to the first in a series of blog posts on WF4 performance. In this post, we will discuss the core workflow runtime. An important reason many of our customers are moving from WF3 to WF4 is the large performance improvements they realize with the WF4 runtime. This post describes a few of these improvements, provides some background on what we did to make it happen, and warns about some common pitfalls. Please note that the data contained in this post is based on prerelease software and is subject to change.

As an example, consider the following While activity built with WF4:

Variable<int> i = new Variable<int>();
new While(env => i.Get(env) < 100)
{
    Variables = { i },
    Body = new Increment
    {
        X = i,
    },
};


public class Increment : CodeActivity
{
    public Increment()
        : base()
    {
    }

    public InOutArgument<int> X
    {
        get;
        set;
    }

    protected override void Execute(CodeActivityContext context)
    {
        X.Set(context, X.Get(context) + 1);
    }
}

In the lab, we observe that the throughput of this WF4 workflow is 273 times the throughput of a comparative WF3 workflow. In other words, on this lab machine, we execute 273 times as many of WF4 workflows per second as the WF3 workflow.

Now, the performance improvements will vary greatly from one workflow definition to another. It will be far less dramatic for many other workflows, or even more dramatic for others, but overall, these improvements symbolize the work we’ve put into making WF4 far more performant.

There are multiple behind-the-scenes reasons for why you see these improvements:

Introduction of a formal data flow model and scoping rules

There were no scoping rules for data in 3.0 or 3.5 – you could bind activity properties without clear boundaries. So, we had to keep significant state around for the lifetime of your workflow.

In WF4, we provide a consistent model for sharing state among activities (with variables, arguments, and expressions). More importantly, we also have rules for data scoping that enable us to do very efficient cleanup of state when it is no longer needed. In WF4, we consider only the variables of currently executing activities active state.

Earlier, it was impossible for the runtime to reason about what was in scope, and what state wasn’t needed any more, and this forced us to carry around a lot of unnecessary state.

Separation of activity definition from activity instance

In WF3, activity types were configured at design time, and the same types were instantiated at runtime. This model had performance implications, because for each workflow instance, the entire activity tree was kept in memory (or persisted when it was unloaded). 

In .NET 4.0, we’ve separated the notion of program definition from activity instance. The type you use to author an activity is instantiated only as part of a workflow definition.  It is not maintained as part of instance state.

Instead, scheduling in WF4 creates lightweight ActivityInstances which represent the execution state for an activity. As I mention in the first bullet point, this execution state primarily includes the values of variables declared on this activity.

Improved activity cleanup and activity creation

Beyond the separation of activity definition from activity instance, we also modified the activity lifecycle so that we proactively cleaned up activities that were no longer executing. Just as important, we’ve removed the initialized state from activities. Now, an activity instance is only created when it is scheduled.

Elimination of bottlenecks that made looping constructs significantly less performant in WF3

For all the reasons described above, writing activities that performed any kind of looping in WF3 was challenging, because you had to maintain a template activity, spawn, and cleanup children. Also, in WF3, every time we tried to run the child of a While, we would use the binary formatter to replicate the entire tree every time. This was extremely expensive, and as a result, performance-sensitive workflow developers started eliminating loop constructs from workflows altogether!

Now, because activity types are instantiated only as part of the workflow definition, and because it is not maintained as part of instance state, not only is writing looping activities far easier, scheduling them is also significantly more performant.

This should begin to provide a view of how we’ve invested in performance on just the workflow runtime. Discussion of persistence has been intentionally left out of this discussion. There will be a different, future post on persistence performance.

Two gotchas to keep in mind: Before you leave, there are two performance warnings about a few common mistakes we’ve seen customers make.

Not caching the workflow definition. The first common mistake we’ve seen customers make is not caching the workflow definition before execution. In other words, instead of creating the definition and using it during subsequent executions, some customers unintentionally re-create the definition from scratch during every invocation (in the example above, that would mean instantiating a new While activity before every execution). Recreation of the workflow definition is a bad idea not just because of the object creation, but also because preparing the definition involves calling CacheMetadata to build the runtime activity tree.                

Blocking the thread. The second common mistake is blocking the thread, often unknowingly relying on expensive operations in activities. In the WF4 threading model, one thread at a time is used to process work items in a workflow instance. While this helps simplify the programming model for activities, it also means that activities should not block this thread. Note that expensive operations come in many forms, so keeping this warning in mind is not always obvious. Also, WF4’s new asynchronous activity capability allows you to perform work off of the workflow thread while keeping the instance in memory; for more information, please see the new async activity sample in the .NET 4 RC SDK.

If you’d like to see any other topics discussed in the future, please let us know!

 

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, “Courier New”, courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }

Visual Studio 2010 RC

Following the release of Visual Studio 2010 Release Candidate, I installed it on one of my laptops. I ran into some minor issues with the Silverlight dev tools SDK, but I hear they’ve been resolved for RTM. Other than that, it seems to be working fine.
I’ve already updated my Current Line Highlighting and Keyword Classifier […]

Discover a New WCF with Discovery!

Juval Lowy has a great article in the January 2010 issue of MSDN Magazine: Discover a New WCF with Discovery.  He goes into the basics of Discovery, how it works and why you would use it, and also provides his own set of helper classes that you can download to make using discovery in your application even easier.  Then he shows how to use these classes to build a publish-subscribe service using WCF.

4.0 Beta2->RC WCF/WF List of Breaking changes


This list covers known breaking changes between 4.0 Beta2 and RC WCF & WF Framework.  


Summary of Breaking Changes


 


FlowChart Designer produces FlowSwitch<T> instead of FlowSwitch


Description: In Beta2 the FlowSwitch item in the activities toolbox produces a non-generic FlowSwitch. Post Beta2, it produces a FlowSwitch<T>. The reason for the change is that non-generic FlowSwitch (used in beta2 and earlier) only allowed to switch on strings (e.g. all keys in the cases needed to be strings) while FlowSwitch<T> allows to switch on any type of T.


Customer impact: Flowcharts that use a FlowSwitch and have been authored using the WF designer in Beta2 or earlier won’t load in the WF designer post beta2.


Mitigation: If you’re using FlowSwitch in a Flowchart workflow using Beta2 (or pre-Beta2 builds), you will need to hand edit the Flowchart XAML and add x:TypeArguments=”x:String” to the FlowSwitch node as shown in the snippet below (highlighted code):


Beta2


<FlowSwitch x:TypeArguments=x:String Default={x:Reference __ReferenceID2} x:Name=__ReferenceID3 Expression=[variable1]>


  <x:Reference>__ReferenceID0<x:Key>Ray</x:Key></x:Reference>


  <x:Reference>__ReferenceID1<x:Key>Bill</x:Key></x:Reference>


</FlowSwitch>


RC


<FlowSwitch x:TypeArguments=x:String Default={x:Reference __ReferenceID2} x:Name=__ReferenceID3 Expression=[variable1]>


  <x:Reference>__ReferenceID0<x:Key>Ray</x:Key></x:Reference>


  <x:Reference>__ReferenceID1<x:Key>Bill</x:Key></x:Reference>


</FlowSwitch>


 


Reference Types in Literal <T> Expressions


Description:  Literal expressions are represented in WF using the Literal<T> activity.  In Beta2 any type could be used with this expression.  In RC It is invalid to initialize Literal<T> with an instance of a reference type.  String is the only exception to this rule.  The motivation for the change was that users erroneously thought that creating a Literal<T> with a new reference type created the new reference type for each instance of the workflow.  Disallowing “Literal” reference types eliminates this confusion.  In Beta2 the following workflow definition would run without error.  In RC it will receive a validation error:


‘Literal<List<String>>’: Literal only supports value types and the immutable type System.String.  The type System.Collections.Generic.List`1[System.String] cannot be used as a literal.


 


List<string> names = new List<string> {“Frank”, “Joe”, “Bob” };


 


Variable<List<string>> nameVar = new Variable<List<string>> { Default = new Literal<List<string>>(names)};           


//Note: the following is the equivalent to the line above, the implicit cast creates a Literal<T> expression


//Variable<List<string>> nameVar = new Variable<List<string>> { Default = names };


 


DelegateInArgument<string> name = new DelegateInArgument<string>();


 


Activity program = new Sequence


{


    Variables = { nameVar },


    Activities =


    {


        new AddToCollection<string> {


            Collection = new InArgument<ICollection<string>>(nameVar),


            Item = new InArgument<string>(“Jim”)},


        new ForEach<string>{


            Values = new InArgument<IEnumerable<string>>(nameVar),


            Body = new ActivityAction<string>{


                Argument = name,


                Handler = new WriteLine { Text = new InArgument<string>(name)}}}


    }


};


Customer Impact:  Customers who have used reference types in Literal<T> expressions will need to use a different kind of expression to introduce the reference type into the workflow.  For example VisualBasicValue<T> or LambdaValue<T>.


Variable<List<string>> nameVar = new Variable<List<string>>{


    Default = new VisualBasicValue<List<string>>(“New List(Of String)(New String() {\”Frank\”, \”Joe\”, \”Bob\”})”)};


DelegateInArgument<string> name = new DelegateInArgument<string>();


Activity program =  new Sequence


{


    Variables = { nameVar },


    Activities =


    {


        new AddToCollection<string> {


            Collection = new InArgument<ICollection<string>>(nameVar),


            Item = new InArgument<string>(“Jim”)},


        new ForEach<string>{


            Values = new InArgument<IEnumerable<string>>(nameVar),


            Body = new ActivityAction<string>{


                Argument = name,


                Handler = new WriteLine { Text = new InArgument<string>(name)}}}


    }


};


Mitigation (if any):  n/a


 


IPC channel security descriptor change (Remoting)


Description:  In Beta2, if a user in UAC – User Access Control with administrator privileges creates a named pipe in the IPC (Inter-process Communication) channel then that user’s SID is ACL-ed (Access Control List). However, that enables the user in UAC to access the named pipe when that user loses the administrator privileges.


Post Beta2, we provide users with an API to be able to change the security descriptor in the named pipe so the previous values of security descriptor can be restored. This API helps users to make their apps more secure and consists of a new IPCChannel constructor that takes an extra fourth argument with a custom security descriptor to override the default one:


public IpcChannel(IDictionary properties, IClientChannelSinkProvider clientSinkProvider,
                                  IServerChannelSinkProvider serverSinkProvider, CommonSecurityDescriptor securityDescriptor)
{
}


Customer Impact:  Customers that create IPC channel in Beta2, will notice the change of the default security descriptor if their security descriptor must be different than the provided one in beta2. However, in post Beta2, you can now specify your own security descriptor using the new added constructor.


Mitigation (if any):  We have provided the API described above that will allow users to set their own security descriptor.


 



Type change for the EventTime property in the TrackingRecord API


Description:  In Beta2, the EventTime property within System.Activities.Tracking.TrackingRecord was of the type System.DateTimeOffset, post Beta2 the type was changed to System.DateTime. The EventTime property stores the time in UTC when the TrackingRecord was emitted.


public abstract class TrackingRecord {
             
             public System.DateTime EventTime { get; }
            
}


Customer Impact:  Customers who have created a custom tracking participant which consumes TrackingRecord objects and access the EventTime property will need to change the type. If the logic within the tracking participant implementation assigns the EventTime property from the TrackingRecord, the place where the property is assigned will receive a DateTime type instead of DateTimeOffset.


Mitigation (if any):  none.


 


New Persistence impacts


Description: Due to large changes in the instance schema and logic, it is not possible to migrated persisted data from Beta 2 to RC.





Customer Impact: To upgrade from Beta 2 to RC, discard any existing instances and resubmit data.  Alternatively, install RC on separate physical or virtual machines and target a different database than used for Beta 2.


Mitigation (if any):  none.


 


 


 — Khalid Mouss.