Extension Method

hello everybody,

Extension method are not well know but they are very powerfull.

This article is not a tutorial with extension method but an inventory around it.

When use it

Extension method must be use only for technical issues never for business requirement.

For example, you have a string and you want to split it into list of fix lenght substring (Why MS doesn’t includes in the box????)

public static class StringExtensions{    
    public static List<string> SplitIntoParts(this string input, int partLength)
    {        var result = new List<string>();
        int partIndex = 0;
        int length = input.Length;
        while (length > 0)
{
            var tempPartLength = length >= partLength ? partLength : length;
            var part = input.Substring(partIndex * partLength, tempPartLength);
            result.Add(part);
            partIndex++;
            length -= partLength;}
        return result;
    }

}
And the manner how we call it

string longString = "This is a very long string, which we want to
 split on smaller parts every max. 30 characters long."; // Length: 98
var partLength = 30;
var parts = longString.SplitIntoParts(partLength);

How implement it

As I said previously, extensions are designed for technicals cases. The extension’s code shall not exceed ten or twenty lines.

In Visual Studio,  I recommend to store extensions in one project dedicated. This project can be referenced in each artifact.

Moreover, you can manage your extensions near your client project, in fact String.SpliintParts method should be the same in your client A and your client B, so manage your extensions in your own project.

Where do I can find extensions method

I recommend a great site http://extensionmethod.net/

It includes not only .NET extensions, but don’t use all extensions without reading the code. Make sure you understand what it does, and all methods may not bug free

 

 

 

 

Associate a work item before check-in instead of resolve it

All VS developper meet this problem, when you check-in on a work item, by default it resolve it.

To clear this issue, go to regedit and update this specific key

in VS 2010

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Behavior]

« ResolveAsDefaultCheckinAction »= »False »

In VS 2012

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\TeamFoundation\SourceControl\Behavior]

« ResolveAsDefaultCheckinAction »= »False »

Biztalk 2010 Cumulative update 6 and BizTalk Adapter Pack cumulative update 3

On July 16th, the new CU (cumulative update) package for BizTalk 2010 became available . This CU contains lot of kb (see the list below)
For BizTalk 2010, you can download here : http://support.microsoft.com/kb/2855367/en-us
BizTalk Server EDI support

KB article number Description
2777584 FIX: The value for the « maxOccurs » attribute is invalid when you validate the BizTalk X12 EDI 835 schema in a BizTalk EDI application in BizTalk Server 2010
2778133 FIX: Message is suspended when you try to receive an encrypted AS2 message together with asynchronous MDN in BizTalk Server 2010
2858166 FIX: « Too many data elements » error when you receive an EDI X12 997 message in BizTalk Server 2010
BizTalk Server Adapters
KB article number Description
2811803 FIX: First submitted message takes longer to process than expected after periods of inactivity when you use a BizTalk Server 2010 WCF-Custom adapter
2855762 FIX: SQL connection leak when you use WCF-based SQL Adapter one-way send port to return a result set from a database in BizTalk Server 2010
2813294 FIX: 2-way WCF-BasicHttp receive port does not respond to a WCF client when the « failed message routing » feature is enabled in BizTalk Server 2010
2823757 FIX: The memory that a BizTalk host process consumes increases when there are no messages in the queue in BizTalk Server 2010
2804250 FIX: You cannot send files from an FTP server to BizTalk Server 2010 by using the FTP adapter when you specify a temporary folder as an absolute path
2742875 FIX: JDE and TibcoEMS adapter property assemblies contain no namespace and all properties are missing in BizTalk Server 2010

BizTalk Server Design Tools

KB article number Description
2818904 FIX: NullReferenceException exception when you use the « BizTalk WCF Service Publishing Wizard » to publish schemas as WCF services
BizTalk Server Message Runtime, Pipelines, and Tracking
KB article number Description
2792865 FIX: A send port that subscribes to an ErrorReport namespace context property cannot deliver an output message in BizTalk Server 2010
2802453 FIX: Pipeline on receive locations reverts to pass-through after you update the schema assembly in BizTalk Server 2010
2836801 FIX: « The transaction has already been implicitly or explicitly » error message when you deploy a large tracking profile in BizTalk Server 2010
2689953 FIX: XML declaration is removed at a receive location that uses BAM tracking and the PassThruReceive pipeline in BizTalk Server 2010

BizTalk Server Administration Tools and Management APIs

KB article number Description
2728652 FIX: The tracking settings of PassThruTransmit and PassThruReceive pipelines are unexpectedly discarded when you remove a BizTalk application in BizTalk Server 2010
2749592 FIX: Slow performance when System Center Operations Manager monitors a computer in BizTalk Server 2010

BizTalk Server Orchestration engine

KB article number Description
2835689 FIX: « The InnerText property is write only » error message when you use System.Xml.XmlDocument in BizTalk Server 2010

For BizTalk Adapter pack, you can download here : http://support.microsoft.com/kb/2617150

VSTS bug number KB article number description
1249726 2845542 FIX: Package variables trigger operations fail when you use BizTalk Adapter for Oracle Database to connect to Oracle Database
1249588 2845538 FIX: « Column ‘PROVIDERTYPE’ does not belong to table SchemaTable » exception when you use BizTalk Adapter for Oracle Database to connect to an Oracle database
1266767 2845536 FIX: Messages become stuck in SM58 when you use a WCF-based SAP Adapter in BizTalk Server 2010
1243883 2836739 FIX: WCF-SAP adapter receive location freezes under heavy load when it works as a tRFC server
1158982 2800376 FIX: WCF-based SQL Adapter stops polling data when daylight saving time ends
1152657 2795080 FIX: SQL Server connections are not released when invalid messages are passed by the WCF-SQL adapter
1055658 2761439 FIX: Configured time-out value for adapter binding properties does not work when a WCF workflow application uses an adapter to connect an LOB Server instance
1031951 2746855 FIX: Database connection leak when you use Microsoft BizTalk Adapter for Oracle Database to receive messages from an Oracle database in BizTalk Server 2010

BizTalk: List of Errors and Warnings, Causes and Solutions

A client ask me to create a wiki about BizTalk errors and how to clear it.

A quick search on your favorite search engine give me a great technet article.

I share it with you because it covers a lot of errors and the explanations are efficients

http://social.technet.microsoft.com/wiki/contents/articles/7204.biztalk-list-of-errors-and-warnings-causes-and-solutions.aspx

Don’t forget to add it in your favorites

Persistence points, tired to repeat it

Often ignored, but a really important, persistence points in Biztalk are the key issue in dealing with Orchestration Performance. Many applicative problem come from a misunderstanding of this concept.

Sandro perreira (a great biztalk MVP) wrote a great article about it : http://sandroaspbiztalkblog.wordpress.com/2009/10/23/biztalk-orchestration-%E2%80%93-understanding-persistence-points/

You should read it,

All BizTalk developper must be careful to those concepts and organize their developpement around it.

A common mistake is the send port in a while shape, more than 50 send don’t forget to use atomic scope.

Another one, be careful with custom c# object and the serialization way.

Really interesting.

How To disable asp.net development server

People who have large solution with lot of differents projects type (BizTalk, c# WCF….) may want to disable the debugging webserver, when they enter in debug mode.

On the web you can find lot of solution like updating regiter key or delete web debug server.

But the simpliest technic is to disable the project to start the debug asp server :

Click on the project, then go to the property tab and set to false the property « Always Start When debugging » :