If you get this mysterious error in a BizTalk orchestration:
Value cannot be null. Parameter name: val
If you are running an orchestration, then a potential problem is that you tried to set a “distinguished field” to the value of NULL.
How I hit this error today ? I had a config parm from the BTNTSVC.exe.config file, that the orchestation was using to set the distinguished field. I thought the parm was optional, so I removed it from the config file. Then “BOOM” – the orchestration that had been working for months quit working with the “mystery error” above.
So now, I check for the config parm, and if it’s null, I reset it to an empty string.
May 17, 2017 Pipeline C# ReplaceString Issue
Value cannot be null. Parameter name: oldValue
Today, this happened in a pipeline component. Due to a logic error, a field had a value of Null, and it was being passed to a C# ReplaceString function as the “oldValue”. The oldValue parm can be an empty string, but it cannot be null.
My client uses a non-standard SQL port number.
So for example, when connecting in SSMS (SQL Server Management Studio), we type in “MyServer,1234” for the server name. This also works in connection strings (i.e. specify servername, then comma, then port number.
I suppose if you were using a named instance, it would be “MyServer/MyInstance,1234”.
But if you are using WCF/SQL Adapter, it’s a little obtuse, you must specify the port number in the “InstanceName” property field, even though you are not using an instance:
Specifing port number for SQL Server (in WCF/SQL Adapter for BizTalk)
Type a comma, followed by the port number in the instance name.