Welcome to BizTalk Development Sign in | Join | Help
Unit Testing ASP.NET? ASP.NET unit testing has never been this easy.

Typemock is launching a new product for ASP.NET developers – the ASP.NET Bundle - and for the launch will be giving out FREE licenses to bloggers and their readers.

The ASP.NET Bundle is the ultimate ASP.NET unit testing solution, and offers both
Typemock Isolator, a unit test tool and Ivonna, the Isolator add-on for ASP.NET unit testing, for a bargain price.

Typemock Isolator is a leading .NET unit testing tool (C# and VB.NET) for many ‘hard to test’ technologies such as SharePoint, ASP.NET, MVC, WCF, WPF, Silverlight and more. Note that for unit testing Silverlight there is an open source Isolator add-on called SilverUnit.

The first 60 bloggers who will blog this text in their blog and tell us about it, will get a Free Isolator ASP.NET Bundle license (Typemock Isolator + Ivonna). If you post this in an ASP.NET dedicated blog, you'll get a license automatically (even if more than 60 submit) during the first week of this announcement.

Also 8 bloggers will get an additional 2 licenses (each) to give away to their readers / friends.

Go ahead, click the following link for more information on how to get your free license.


For those who has deployed a BAM activity definition, it may come as a surprise when denied access to the BAM portal.

Access to the BAM portal is configured via the BM.exe utility. This tool is used to administer all things related to BAM, including deployment, permissions, and alters.

The command line tool is located at the following location:

[BizTalk installation folder]\Tracking\bm.exe

Sample usage:


bm.exe add-account -AccountName:[Domain\GroupName] -View:[BAM View]
  or
bm.exe add-account -AccountName:[Domain\SamAccountName] -View:[BAM View]

1 Comments
Filed under:

Happy Chinese New Year!

It has been 17 months since my last post. I didn't mean to stop blogging but right after wrapping the BizTalk project in September 2007, I was given an irresistible opportunity to join Microsoft Consulting Services (MCS).

Joining Microsoft has been an experience unlike any other. I had more opportunities to expand my knowledge than my puny brain was able to absorb. It is quite exhilarating at the same time humbling.

I started this post with the intent of making some poor excuses for not posting during this past 17 months. But half way through it, I realize how much I missed sharing my knowledge and decided that perhaps I should 'make' time to blog.

So my Chinese New Year’s resolution (kind of late for Gregorian calendar New Year) will be to start posting again. Hopefully you won’t have to wait another 17 months before seeing another post.

 

0 Comments
Filed under:
It has been awhile since I last blogged. I have been away working on a very interesting project for a financial services company. The project entailed building a service broker using BizTalk 2006 (not R2) with WCF to achieve better decoupling of service consumers and service providers. Now that the project has entered the code-freeze stage, I shall have more time to write about the interesting design challenges and how I solved them. Stay tuned...

When deploying a BizTalk 2006 solution from Visual Studios, you may have encountered errors similar to the one pictured below:

Failed to update binding info.jpg

Due to a quirk in BizTalk, the cached binding information sometimes gets in the way of deployment. The easiest way to get around this problem is to simply stop (Full) the offending application in the Admin Console, then retry the deployment.

 

 

 

I was querying Search using SharePoint's object model when I encountered the following error message:

"Your search cannot be completed because this site is not assigned to an indexer. Contact your administrator for more information."

The answer turned out to be quite straight forward. To assign an indexer, launch the SharePoint 3.0 Central Administration console:

SharePoint 3.0 Central Administration > Application Management > SharePoint Web Application Management : Content databases > [select the content database used by your site] > Search Server : Select Windows SharePoint Services search server

That's it!

One of the great features with SharePoint is its seamless integration with Office. The new MOSS 2007 is no exception. However, there is a pretty nasty bug that somehow slipped through Microsoft's QA process. This bug can be reproduced if you access MOSS 2007 with a machine that has a mixed Office 2003 + 2007 installation. For example: You have Office 2003 for Word and Excel,  and then you installed SharePoint Designer 2007.

When you access a MOSS site and click on a feature that requires Office, you will get the following error that will crash IE7:

ErrorMessage.jpg

You are getting this error because the installation of a Office 2007 application places a copy of OWSSUPP.DLL on your computer. Your browser calls this DLL to interact with Office and if you don't have the 2007 version of Word, Excel, or InfoPath, it doesn't know what to do. You will need to disable the version of OWSSUPP.DLL found in the directory below (rename it to OWSUPP.DLLX for example.).

C:\Program Files\Microsoft Office\Office12\OWSSUPP.DLL (File Version : 12.0.4518.1014)


By disabling the offending version of the DLL, your browser will recognize that you have the wrong version of Office and display the appropriate error message like this one:

CorrectError.jpg

 

 

 

You may have to written code that checks if an object is null before you use it. For example:

Rexx.Lexer.RexxCodeStatementList list = null;
string name;
if (list != null)
{
   if (list.Count > 1) name =list[1].Name;
}
else
{
   name = "-NA-";
}

This can be abbreviated into the following code using the && operator:

Rexx.Lexer.RexxCodeStatementList list = null;
string name;
if (list != null && list.Count > 1)
{
   name =list[1].Name;
}
else
{
   name = "-NA-";
}

The && (andalso in VB.NET) shortcircuit the if statment when false.

0 Comments
Filed under: ,

Knowing all the classes in the CodeDOM namespace isn't very useful unless one knows how to appy them. This blog entry will serve as a cheat sheet for the most commonly used expressions and statements. This page is a work in progress.


MyClass.Method("value", 4)

System.CodeDom.CodeExpression expr = new CodeMethodInvokeExpression(
   new CodeMethodReferenceExpression(new CodeVariableReferenceExpression("MyClass"), "Method"), 
   new CodePrimitiveExpression("value"), 
   new CodePrimitiveExpression (4)));

MyClass.Method("value", GetItemByIdex(4))

System.CodeDom.CodeExpression expr = new CodeMethodInvokeExpression(
   new CodeMethodReferenceExpression(new CodeVariableReferenceExpression ("MyClass"), "Method"), 
   new CodePrimitiveExpression("value"), 
   new CodeMethodInvokeExpression(
      new CodeMethodReferenceExpression (new CodeThisReferenceExpression (), "GetItemByIndex"),
      new CodePrimitiveExpression (4))));

string.Empty

System.CodeDom.CodeExpression expr = new System.CodeDom.CodeFieldReferenceExpression(new System.CodeDom.CodeTypeReferenceExpression (typeof(string)), "Empty");

this.Method

System.CodeDom.CodeExpression expr = new System.CodeDom.CodeFieldReferenceExpression(new System.CodeDom.CodeThisReferenceExpression (), "Property"); // this.Property

x = 0xFF

System.CodeDom.CodeExpression expr = new CodeVariableReferenceExpression("x"),
   new CodeSnippetExpression ("0xFF")));

for (int i = 0; (i< 8); i=(i+1)){}

CodeVariableReferenceExpression var = new CodeVariableReferenceExpression ("i");
CodeIterationStatement forLoop = new CodeIterationStatement(
   new CodeVariableDeclarationStatement(typeof(int), "i", new CodePrimitiveExpression (0)),
   new CodeBinaryOperatorExpression(var, CodeBinaryOperatorType.LessThan, new CodePrimitiveExpression (8)),
   new CodeAssignStatement(var, new CodeBinaryOperatorExpression(var, CodeBinaryOperatorType.Add, new CodePrimitiveExpression (1)))));


* the extra white space in some of the code is to avoid the censoring mechanism which I didn't want to turn off.
0 Comments
Filed under: ,

Your orchestration uses a 2 way RoleLink for delivery but a new trading partner will only accept orders via a one way port. What do you do?

If the RoleLink requires a 2 way port, you’ll have to bind it to a 2 way port. To get around this restriction, you can create a special 2 way send port which sends the message back to a 2 way HttpReceive location (with loop back turned on). The loop back satisfies the response requirement of the 2 way RoleLink. The receive location should then have a 1 way send port subscribe to it which will handle the actual delivery.

 

The other day, in discussing the virtues of automated continuous integration with a client, I came across a few excuses for not adapting the process. The argument goes like this:

  “We don’t have enough hardware resource for a build server.” 
  “I am the sole developer so I don’t need it.”

My response for the first excuse is one word: “Virtualization.” A build server does not require a lot of resource nor tremendous CPU power. If you don’t have a spare computer, what about spare a portion of your computer? A 256MB memory partition and 5GB of disk space is enough to host an OS complete with CruiseControl.NET, nAnt , nUnit, Visual Studio 2005, and even SQL. Another advantage of using a virtualized build server is that you can make a snap shot of a working system and easily revert to it in the event that your build process corrupts the system (such as the install script screwing up the registry hive or SQL script dropping the wrong database).

The second excuse is just as invalid. First of all, the practice of continuous integration enforces good development habit. If you have unit test for all your work, you are already way ahead of the curve. Why not leverage the power of the computer to help you with integration testing as well? Secondly, how many of you can honestly remember all the intricate code you wrote months ago and can confidently alter it without extensive regression testing?

I, for one, like to refactor my code as I progress through a large project. Some of my changes may pass my unit test but fails in an integration test. As I usually partition my projects so I am only focused in one portion at a time. Automated continuous integration helps me catch problems like that before it gets too hairy to tackle.

Remember, automated continuous integration is your friend.

The Tracking Profile Editor (TPE), allows the user to add or remove tracking profile without having access to the a .BTT file (not possible with bttdeploy.exe).

Tracking Profile Editor> Tools > Remove Tracking Profile

It is possible to apply a new tracking profile without first remove a previous profile. When applying tracking profiles, sucessive profiles are stored and only the last one is active (hybernated activities will continue to use the older profile until completed). When removing tracking profiles, all profiles are removed. This makes it very handy in development mode.  However, I came upon this error today when I tried to remove my profile:

Failed to remove the tracking profile. (Microsoft.BizTalk.Bam.TrackingProfileEditor.MainForm) Error removing tracking profile for messaging. (Microsoft.BizTalk.Bam.TrackingCompiler.MessagingDeployer)

Normally, the TPE is able to remove the tracking profile even if I make changes to the in memory copy. However, this time, it had difficulty resolving the differences. So I had to exit the TPE. I reloaded the TPE, imported the BAM definition, and then removed the tracking profile successfully.

 

0 Comments
Filed under: ,

Here is a code snippet for writing information to the EventLog. This code will work in a BizTalk Expression Shape as well as in a .NET application.

if (!System.Diagnostics.EventLog.SourceExists("BizTalkDev.Assembly.Namespace"))
{
  System.Diagnostics.EventLog.CreateEventSource("BizTalkDev.Assembly.Namespace", "Application");
}
System.Diagnostics.EventLog.WriteEntry("BizTalkDev.Assembly.Namespace", "Error Message Here", System.Diagnostics.EventLogEntryType.Error);

Instead of writing to the "Application" folder, you might consider using your own folder (replace "Application" with "MyEventLogFolderName") so it will be easier to find your Events.

If you get an EventLog access error, see this post for the correct registry setting.

 

This morning I discovered that my Windows Defender no longer worked. I was prompted with a non-intuitive error message:

Application failed to initialize: 0x800106ba. A problem caused Windows Defender Service to stop. To start the service, restart your computer or search Help and Support on how to start a service manually.

Following one of the recommendations -- reboot -- did not yield any positive result. I decided to do a System Restore to a point before the last Windows Defender definition was updated thinking that the definition may have corrupted Windows Defender. To my dismay, System Restore no longer works either.

It did not immediately dawn on me that the Beta 2 version I was running had expired and I simply had to upgrade to the release version that Microsoft has provided free of charge at the following link:

http://www.microsoft.com/downloads/details.aspx?FamilyId=435BFCE7-DA2B-4A6A-AFA4-F7F14E605A0D&displaylang=en

You would think Microsoft would provide the proper expiration warning for a product that expires after a certain date. No such luck.

So, there you have it. If you ran into the same issue, head on over to Microsoft and download the Release version of Windows Defender.

0 Comments
Filed under:
I just ordered a Dell SC1435 and I must say that I am very impressed with how much computing power Dell packed into a diminutive 1U space. My server is equipped with 2 AMD Opteron dual core processors running at 1.8 Ghz, 4 GB of RAM and 80GB HD for only $1,809 after tax and shipping. I think I paid almost as much for my Motorola 6502 powered 8-bit computer back in the 80s. I can't wait to test BizTalk development on it. Below is a little video clip I found that showcase the machine:

<a href="http://www.youtube.com/v/OsB0D2zQdBA"><img src="/Themes/default/images/video.gif" border = "0" width="425" height="350"></a><br /><a href = "http://www.youtube.com/v/OsB0D2zQdBA">View Video</a><br />Format: ???<br />Duration: --:--

0 Comments
Filed under: , ,
More Posts Next page »