Tuesday, October 27, 2009
It can be a challenge to move a project from one TFS source control to another. This is because TFS has the concept of workspaces. These workspaces are generally behind the scenes so you do not know they are being created. If you try and move a project that is currently associated with a workspace it will complain when you try and connect the same project with a new source control.
The first step is to remove the workspace binding. To find the workspaces go to: File>Source Control>Workspaces.
This will bring up the ‘Manage Workspaces’ window.
By selecting edit or double clicking on a name, the ‘Edit Workspace’ window will opened.
Select the workspace for the project you want to move to the new sever and delete it. VS should
allow you to move the project without any additional problems. To connect to the new server
go to: Tools>Connect to Team Foundation Server…
Click on the server button then on the Add/Remove Team Foundation Server window select Add.
Enter CorpTFS01 and OK, then Close. Select the new Server in the drop down list of the ‘Connect
To a Team Foundation Server’ dialogue box. The available Team Projects for the selected sever
will be displayed. Select all or the specific projects that you are interested in and click OK.
Wednesday, June 17, 2009
I have just encounted an unusual database problem. My dev BizTalk server suddenly ran out of space. Initially I thought it was the transaction logs. No luck there they were well within normal limits. I did check the size ot the
'Microsoft SQL Server' directory. It was over 8GB. The volume was traced to the LOG directory. SQL was pumping out 4 MB of error log every 10 seconds. After fighting with the server to free up some disk space, I checked out the error files. The parts appear to be:
***Stack Dump being sent to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLDump7243.txt
* *******************************************************************************
*
* BEGIN STACK DUMP:
* 06/17/09 15:52:15 spid 54
*
* CPerIndexMetaQS::ErrorAbort - Index corruption
*
* Input Buffer 510 bytes -
* EXECUTE msdb.dbo.sp_sqlagent_log_jobhistory @job_id = 0xBE810
* 129F3D1574AA4EB72EE897A6CCC, @step_id = 0, @sql_message_id = 0, @sql_sev
* erity = 0, @run_status = 1, @run_date = 20090617, @run_time = 155201, @r
* un_duration = 3, @operator_id_emailed = 0, @operator_id_netsent = 0, @op
* erator_id_paged = 0, @retries_attempted = 0, @session_id = 65, @message
* = N'The job succeeded. The Job was invoked by Schedule 4 (Schedule). T
* he last step to run was step 1 (Purge).'
And
2009-06-17 15:52:14.55 spid56 Error: 8646, Severity: 21, State: 1.
2009-06-17 15:52:14.55 spid56 Unable to find index entry in index ID 1, of table
117575457, in database 'msdb'. The indicated index is corrupt or there is a
problem with the current update plan. Run DBCC CHECKDB or DBCC CHECKTABLE. If
the problem persists, contact product support.
2009-06-17 15:52:15.24 spid54 Using 'dbghelp.dll' version '4.0.5'
2009-06-17 15:52:15.24 spid54 **Dump thread - spid = 54, PSS = 0x0DDD32D0, EC = 0x0DDD32D8
2009-06-17 15:52:15.24 spid54 ***Stack Dump being sent to C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\LOG\SQLDump7243.txt
2009-06-17 15:52:15.24 spid54 * *******************************************************************************
2009-06-17 15:52:15.24 spid54 *
2009-06-17 15:52:15.24 spid54 * BEGIN STACK DUMP:
2009-06-17 15:52:15.24 spid54 * 06/17/09 15:52:15 spid 54
2009-06-17 15:52:15.24 spid54 * 2009-06-17 15:52:15.24 spid54 * CPerIndexMetaQS::ErrorAbort - Index corruption
Searching for 'CPerIndexMetaQS::ErrorAbort - Index corruption' online led me to a post that suggested running the following SQL script from SQL Server Manager on the local machine.
DECLARE tempcursor
CURSOR
READ_ONLY
FOR
select spid From master..sysprocesses
where dbid = (select database_id from sys.databases where name = 'msdb')
DECLARE @name int
OPEN tempcursor
FETCH NEXT FROM tempcursor INTO @name
WHILE (@@fetch_status <> -1)
BEGIN
exec('kill ' + @name)
FETCH NEXT FROM tempcursor INTO @name
END
Use msdb
Go
sp_dboption 'msdb', 'single_user', 'true'
GO
DBCC CHECKDB('msdb', REPAIR_REBUILD)
go
sp_dboption 'msdb', 'single_user', 'false'
CLOSE tempcursor
DEALLOCATE tempcursor
The script found and repaired the corrupt index, as shown below.
DBCC results for 'sysdownloadlist'.
There are 0 rows in 0 pages for object "sysdownloadlist".
DBCC results for 'sysjobhistory'.
Repair: Successfully deleted row in index "dbo.sysjobhistory, nc1" in database "msdb".
Msg 8952, Level 16, State 1, Line 1
Table error: table 'sysjobhistory' (ID 117575457). Index row in index 'nc1' (ID 2) does not match any data row. Possible extra or invalid keys for:
The error has been repaired.
Msg 8956, Level 16, State 1, Line 1
Index row (1:1141:114) with values (job_id = '89F8A96E-AF2B-4BE9-B5E4-FEF3B8C94EC5' and instance_id = 466459) pointing to the data row identified by (instance_id = 466459).
There are 6640 rows in 459 pages for object "sysjobhistory".
CHECKDB found 0 allocation errors and 1 consistency errors in table 'sysjobhistory' (object ID 117575457).
CHECKDB fixed 0 allocation errors and 1 consistency errors in table 'sysjobhistory' (object ID 117575457).
The log file generation has stopped and the server appears to be back to normal.
Wednesday, June 03, 2009
If you can find the control panel for DEP, you will find there is not an option to turn it off.
This is not a terrible thing unless you are trying to troubleshoot a problem.
Then you want to eliminate it as an issue, to confirm that the application will work in the environment as a whole. Then you can re enable it and try to configure DEP correctly to allow your application to function:
Access to DEP configuration panel-
1. Click Start, click Run, type sysdm.cpl, and then click OK.
2. On the Advanced tab, under Performance, click Settings.
3. On the Data Execution Prevention tab, use one of the following procedures:
a. Click Turn on DEP for essential Windows programs and services only to select the OptIn policy.
b. Click Turn on DEP for all programs and services except those I select to select the OptOut policy, and then click Add to add the programs that you do not want to use the DEP feature.
4. Click OK two times.
There are actually 4 global configurations for DEP-
|
Configuration
|
Description
|
|
OptIn
|
This setting is the default configuration. On systems with processors that can implement hardware-enforced DEP, DEP is enabled by default for limited system binaries and programs that "opt-in." With this option, only Windows system binaries are covered by DEP by default.
|
|
OptOut
|
DEP is enabled by default for all processes. You can manually create a list of specific programs that do not have DEP applied by using the System dialog box in Control Panel. Information technology (IT) professionals can use the Application Compatibility Toolkit to "opt-out" one or more programs from DEP protection. System compatibility fixes, or shims, for DEP do take effect.
|
|
AlwaysOn
|
This setting provides full DEP coverage for the whole system. All processes always run with DEP applied. The exceptions list to exempt specific programs from DEP protection is not available. System compatibility fixes for DEP do not take effect. Programs that have been opted-out by using the Application Compatibility Toolkit run with DEP applied.
|
|
AlwaysOff
|
This setting does not provide any DEP coverage for any part of the system, regardless of hardware DEP support. The processor does not run in PAE mode unless the /PAE option is present in the Boot.ini file.
|
To turn off DEP globally, we must edit the Boot.ini file. Here are some instructions and an example of a Boot.ini file.-
1. Click Start, right-click My Computer, and then click Properties.
2. Click the Advanced tab, and then click Settings under the Startup and Recovery field.
3. In the System startup field, click Edit. The Boot.ini file opens in Notepad.
4. In Notepad, click Find on the Edit menu.
5. In the Find what box, type /noexecute, and then click Find Next.
6. In the Find dialog box, click Cancel.
7. Replace policy_level with AlwaysOff
Example of a Boot.ini file with /NoExecute set to AlwaysOff-
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=AlwaysOff
Source: http://support.microsoft.com/kb/875352
Wednesday, May 13, 2009
I recently came across a new mapping problem. I needed to make sure that the final document only had one address for a paper mill to satisfy the requirement of a standard documentation format (PAPINet). Usually the product is all made to order but every so often paper may be available from stock that was made in a different mill. The SAP system providing the information contains information on both mills. The challenge here was to remove the additional mills and only include the mill data for the first mill. In this case the mill information is not important as the ID for the paper (TAPI) includes a character that identifies the producing mill.
My first attempt was to limit the number of occurrences of the Mill element. BizTalk ignored the limit.

I then tried to use the 'Data Flattening' functoids with an 'Iteration' functoid. I set the 'Equal' functoid to receive the value from the 'Iteration' functiod and added a constant value of 1 (BizTalk must use 1 base in it's iterations). When the 'Iteration' functoid equals 1 it will resolve to true allowing the 'Data Flattening' functoids to only process the first occurrence of the Mill attribute.

The overall solution is a complex mapping from SAP to PAPINet. It uses a canonical structure to assist in the transformation. This problem was greatly simplified by using the canonical to canonical mapping (added to allow some complex calculations to be preformed).
Thursday, March 12, 2009
I've had a few BizTalk maps that have caused me to stop and think as to how to get over the problem of suppressing nodes when the child node has no data. The issue arises if you use Data flattening shape to block the creation of an element. The child node is suppressed but the parent node is still created. I just found out how to block the parent node from being created so I’m posting it here so I can find it again the next time I need it.

By connecting the parent nodes to the functoid that provides the condition to the data flattening functoids the parent nodes will be suppressed.
Thanks to Saravana Kumar for posting the answer on his blog.
Geordie
Wednesday, January 21, 2009
I just got bit by this one a second time. So it is time to store the information here to avoid a third occurrence.
If you get an exception that the functoid was not found.
For example:- 'Exception Caught: Functoid not found:
guid({5DE500CC-45BC-454b-A23D-24449899042C}) funcid(6123)'
Check that the dll is installed in the mapper extension folder 'C:\Program Files\Microsoft BizTalk Server 2006\Developer Tools\Mapper Extensions' as well as the GAC.
Geordie
Monday, January 19, 2009
How to remove the shutdown tracker.
A: Start > Run MMC
File > Add/Remove Snap-in...
Add...
Group Policy Object Editor
Add
Finish
Close
OK
Local Computer Policy > Computer Configuration > Administrative Templates > System > Dbl-Click "Display Shutdown Event Tracker" and select Disabled.
OK
File
Exit
To help differentiate between production and test I leave the Shut Down Tracker running on production servers and turn it of in development.
Geordie
Tuesday, January 13, 2009
I recently built a recieve location that used used a File adaptor to test the recieve and Orchestration for a new multipart message. It all went well until I converted the recieve port to a HTTP adaptor. At that point my custom component in the recieve pipeline raised a 'method not implemented' error.
After several tests I was sure that the error was specific to HTTP adaptor and was not a problem with the installation of the custom component. One theory that I had was that an aditional method(s) may be required when implementing a custom components in a HTTP recieve pipeline hence the error. This was proven to be wrong.
In fact the issue was due to less methods being implemented in the HTTP adapter API. In this case I was calling a property setter that was implemented in the File adaptor API but not in the HTTP adaptor API. Specifically I was calling msg.BodyPart.Data getter.
To overcome this problem we used the get OriginalDataStream method to retieve the message stream as shown in the code below.
public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
{
//Convert Stream to a string
Stream s = null;
IBaseMessagePart bodyPart = inmsg.BodyPart;
// NOTE inmsg.BodyPart.Data is implemented only as a setter in the http adapter API and a
//getter and setter for the file adapter. Use GetOriginalDataStream to get data instead.
if (bodyPart != null)
s = bodyPart.GetOriginalDataStream();
byte[] bytes = new byte[s.Length];
int n = s.Read(bytes, 0, (int)s.Length);
string msg = new ASCIIEncoding().GetString(bytes).TrimEnd(null);
//Get boundry value from first line of code
string boundry = msg.Substring(2, msg.IndexOf("\r\n")-2);
//Create new start to message with MIME requirements.
msg = "MIME-Version: 1.0\r\nContent-Type: multipart/related; boundary=\"" + boundry + "\"\r\n" + msg;
//Convert back to stram and set to Data property
inmsg.BodyPart.Data = new MemoryStream(Encoding.UTF8.GetBytes(msg)); ;
//reset the position of the stream to zero
inmsg.BodyPart.Data.Position = 0;
return inmsg;
}
(Note: to debug the custom code in the HTTP recieve pipeline attach to the w3wp.exe process)
Tuesday, December 02, 2008
I recently encounter this error. It took a little bit of head scratching to work out why we were getting the error. The possible causes were quite high as we are using dynamically assigned maps (see code below).
Message Assignment Shape Code
| |
SapOrderMapType = System.Type.GetType(SapOrdersMapName);
//transform(MyOutputMsg) = MyMapType(MyInputMsg);
transform (SapOrder) = SapOrderMapType(CanonicalPO);
System.Diagnostics.Trace.WriteLineIf(TraceEnabled, "Transform to SAP schema complete.", TraceCategory);
SapOrder(FILE.ReceivedFileName) = "PO_" + CustomerNumber + "_" + PONumber + "_";
System.Diagnostics.Trace.WriteLineIf(TraceEnabled, "SAP Order Msg Created", TraceCategory);
|
The error information identifies the transform as the problem but not what the problem is. The inner exception is no additional help- ‘Value cannot be null. Parameter name: extension Exception type: ArgumentNullException’.
The problem was eventually tracked down to the custom functoids. In the last map a new functoid was added to convert standard BizTalk dates into standard SAP dates. When the project was deployed the custom functoid dll was not updated.
Interestingly this error might occur intermittently as the functiod may not be needed every time the map is used.
Thursday, November 27, 2008
I have been working on a BizTalk project for a while now and after a bumpy start all has been going well. The current message that we are dealing with is the receipt and processing of a Purchase Order. The processing and mapping of the purchase order to the SAP orders schema went well and all I need to do was to receive the document from the customer. After a bit of a delay in getting an accurate sample message, I set to work on creating a process for receiving a PO from a Ponton server. On examining the sample message I found I was going to need to deal with receiving a Multi Part message.
So I looked at the SDK and searched online but found very little guidance. The samples and discussion where mainly about receiving messages from the POP3 adapter. In our scenario the message will be received by HTTP then dropped to a file. It will then be archived and processed.
How difficult can it be! 4 days latter I can answer the question. It is not easy if you have not dealt with this type of message before. So here is my guidance on this issue.
1. Sample messages. As mentioned the samples that I found were email messages. I was not sure if these samples were relevant to my project. With respect to the message it appears that BizTalk cares about the MIME 1.0, boundary and description declarations. As it happens the message I was receiving was missing all these parts. Also check out this post from Doug -
http://www.tech-archive.net/Archive/BizTalk/microsoft.public.biztalk.general/2006-07/msg00134.html. Unfortunately the final solution was not posted but it helped me get closer to a solution.
2. You will need to make a Multi Part message in your orchestration. This is well covered in blogs and documentation. It is also straight forward. But here is the kicker. When are receiving multi part messages, the order you create the message parts matters!!
Eric did a good job of documenting this ‘undocumented’ feature.
To summarize Eric’s post: The order of the message parts in displayed in VS is alphabetical, but creation order matters and may be different from what is displayed in VS. The message parts need to be created in the order they appear after the message has been split into its parts by the pipeline. The only way to determine the order of creation is to view the orchestration file in a text editor. You can find the message part order by examining the failed message in BizTalk Manager. Drill into the error, go the message tab and double click the message. The message parts should be listed on the left hand side.
If you are getting an
Inner exception: ‘Wrong BodyPartException …’ and ‘Multi-part message has body part ‘XXXXX’, expected body part ‘YYYYYY’, and everything appears to be correct, check this as a possible cause. I lost over a day trying to resolve this issue!
The sample application contains 2 Multi Part messages only the second one works even though they look the same in VS.
3. You will need a custom pipeline. BizTalk uses the MIME component to process multi part messages. Even if the message is not a MIME message it can be processed by setting the ‘allow non MIME message’ property to true. The body part content type field is optional. Valid values are ‘text/xml ‘, ‘application/xml’… etc. The ‘Body part index’ is a 0 based index that identifies the body part by location in the message. It took me a while to discover that I also needed to add an XML dissembler in the pipeline as well. All the message part schemas are added to the ‘Document schemas’ collection.
Tricks that might help:
· Initially type the Multi Part message parts as System.Xml.XmlDocument. This will remove at least one area of possible error. This will allow you to identify other problems and resolve them one at a time.
· View the orchestration file in Notepad. Look for the definition of the multi part message. The order the parts are listed in the XML are the order the message parts were created. Remember creation order matters.
Sample Message
MIME-Version: 1.0
Content-Type: multipart/related; type="text/xml";
boundary="_968002A2-AAE4-43E0-90D3-83461FE91020_"
--_968002A2-AAE4-43E0-90D3-83461FE91020_
MIME-Version: 1.0
Content-Transfer-Encoding: binary
Content-Description: Header
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<eb:MessageHeader xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd" eb:version="2.0" soapenv:mustUnderstand="1">
... Rest of the Header Message....
</soapenv:Body>
</soapenv:Envelope>
--_968002A2-AAE4-43E0-90D3-83461FE91020_
MIME-Version: 1.0
Content-Transfer-Encoding: binary
Content-Description: POMsg
<?xml version="1.0" encoding="UTF-8"?>
<PurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PurchaseOrderV2R30" PurchaseOrderStatusType="Original" PurchaseOrderType="StandardOrder">
... Rest of the Purchase Order Message....
</PurchaseOrder>
--_968002A2-AAE4-43E0-90D3-83461FE91020_--