Testing events in VSTS

Create a anonymous delegate and a variable to set
ManualResetEvent statsUpdatedEvent = new ManualResetEvent(false);
bool serviceFaulted = false;

Classevent += delegate
System.Diagnostics.Debug.WriteLine(“Runtime faulted”);
serviceFaulted = true;


do some operation to trigger the event.
Wait for the event to trigger
statsUpdatedEvent.WaitOne(5000, false);



This is taken from the following link



wshttpbinding – httpsys – netsh – certificates


step 1
“makecert -r -pe -n “CN=localhost” -b 01/01/2000 -e 01/01/2036 -eku -ss my -sr localMachine -sky exchange -sp “Microsoft RSA SChannel Cryptographic Provider” -sy 12″

httpcfg.exe set ssl -i -c “MY” -h XXXXXXXX

for vista and 2008

appid int he netsh http add sslcert is nothing but a new guid(Create one).

server 2008 and vista


appid int he netsh http add sslcert is nothing but a new guid(Create one).

Serialize and deserialize a workflow ruleset


private void SerializeRuleSet(RuleSet ruleSet)
StringBuilder ruleDefinition = new StringBuilder();
WorkflowMarkupSerializer serializer = new WorkflowMarkupSerializer();

if (ruleSet != null)
StringWriter stringWriter = new StringWriter(ruleDefinition, CultureInfo.InvariantCulture);
XmlTextWriter writer = new XmlTextWriter(stringWriter);
serializer.Serialize(writer, ruleSet);
catch (Exception ex)


XmlDocument rule = new XmlDocument();


public static RuleSet GetSampleRule(string type)

ruleSetXmlDefinition = GetEmbeddedTextFileContent(“SampleRule.xml”);

WorkflowMarkupSerializer serializer = new WorkflowMarkupSerializer();

StringReader stringReader = new StringReader(ruleSetXmlDefinition);
XmlTextReader reader = new XmlTextReader(stringReader);
return serializer.Deserialize(reader) as RuleSet;

Testing in biztalk 2009i

Well one of the drawback that i found is we cannot test the out of the box built in pipelines…..

well why do you want to do it???, because i want to test a transform, i want to see if my flat file is getting disassembled properly….etc, you can over come this by creating your own pipelines(a copy of the default ones with the same components)……

Tomas’s testing library handles this very nicely…

Debugging WCF LOB Custom Adapters

1) Gac the assembly
Install the WCF LOB Adapter assembly in the GAC and click Run and paste the following %systemroot%\assembly\gac, navigate to the msil folder(the .net 2.0 assembly are installed here) find your assembly and copy the pdb files in to it
your assembly will be stored in the following structure

— Name of the assembly
— public key token
— .dll file (copy the pdb files here)

in order to automate the process you might want to create a bat file or add a post build command in Visual studio.(Of course the above structure will appear only when you have gaced the assembly first and then create the bat file or the post build script).

So we are ready for debugging

2) Design Time
open up 2 instances of Visual studio
1st instance should contain the WCF LOB Adapter project
2nd should contain the client or biz talk project that you want to import the adapter proxy into

In the first instance attach the 2nd instance Visual studio process from the debug menu, and from the second VS instance perform Add Adapter reference for a .net client or a Add generated items for a Biz talk client.

Once done the debug point in the 1st instance of the Adapter code will be hit.

3) Run Time
Once you gaced WCF LOB Adapter assembly click F5 from your .net application
For biz talk you have to attach the Biz talk process.

and also throw in DebugView and add WCF tracing— 🙂

Note: As you do the changes to the adapter code, you have to restart Visual studio again to load the latest dll, i believe VS caches the dlls.

WCF LOB adapter Metadata changes don’t reflect when you consume the adapter.

I was working the with the WCF LOB adapter and did a small change to the adapter’s operation (added another input parameter from 2 to 3), and gaced the adapter dll, then in the same VS instance i added another project and consumed thte adapter service, nothing has changed the operation still showed only 2 parameters!!!!!!!!!!!!!

Solution: Restart VS and consume the adapter again.

BizTalk Dissasembler

This is an amazing tool to have, one of my resources deleted a BizTalk Map, in came the dissasembler for Reflector and the XSLT was generated from the DLL, ufff… It did save us a lot of time(About to be deployed to PRD).

The disassembler can generate schemas, xslt, orchestartions, pipelines etc…

its a must have for every BizTalk Devloper out there.