Monday, November 5, 2012

EventRecord.FormatDescription() method returns nothing though it has data.



When using System.Diagnostics.Eventing.Reader.EventLogQuery to read events from the Windows Event Log, the EventRecord.FormatDescription() method returns nothing though it has data.
When I set the Current Culture, it starts to working.
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

Hope this will be helpful to anyone who comes across this issue.

Sunday, October 28, 2012

BizTalk 2010 - Hot Fix

I have installed the following Hot Fixes on my BizTalk environment to get rid of the following issues.

Issue:
  After editing one of the complex orchestrations, I could not build the project.
  mismatched 'braces' '{}' error appers on the build output.
Solution:
It worked fine after installing the   FIX: Build operation fails after you modify an orchestration of a BizTalk Server 2010 solution in Visual Studio 2010

Issue:
The following error came when deploying the changed BizTalk solution
Error saving map. Stored procedure returned non-zero result
Solution:
It worked fine after installing the FIX: "Error saving map. Stored procedure returned non-zero result." error message when you deploy the BizTalk Server 2010 applications in BizTalk Server 2010 Administration Console

Tuesday, October 23, 2012

Windows Schdule Task does not support Clustering on Windows 2008 r2

Windows Schedule Task does not support clustering on Windows 2008 r2 Failover Cluster. I have used BizTalk 2010 Scheduled Task Adapter (http://biztalkscheduledtask.codeplex.com/) as an alternative for this

Wednesday, October 17, 2012

issues when creating WCF proxy

I have changed my WCF services and updated the service reference on my test project.
But I could not build the project after that. Then I tried to build it on my old machine and it was built. So this should be an environment issue. I had the following errors & warnings in the output.

Custom tool warning: Cannot import wsdl:portType

Custom tool error: Failed to generate code for the service reference  

There are blogs which say I need to unclick the Reuse types in reference assemblies. But it didn’t work for me.  
Then I tried to run using the WCFStorm tool and I got the following errors

Metadata contains a reference that cannot be resolved: 'http://localhost:8082/Service.svc'.
Import Error : Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Schema with target namespace


I found some blogs which says I need to repair ServiceModelReg & need to run aspnet_regiis.exe –iru. But anything didn’t help me.
Then I found the following link it says this is happening because of permission issues in c:\windows\temp
http://blogs.infosupport.com/unable-to-generate-a-wcf-proxy-using-svcutil-but-retreiving-the-wsdl-works/
Yes It was the issue of environment. Thank you for the above blog writer you have saved my time.

Friday, October 5, 2012

When installing AdventureWorks Sample at CodePlex

I have recently faced this issue and took some time to resolve the issue.

Error : The following error comes when installing the AdventureWorks Sample databases (SQL Server 2008 SR4)

Failed object initialization (ISupportInitialize.EndInit). An exception occurred while executing a Transact-SQL statement or batch. Error at object ‘DatabaseSelection’ in markup file ‘DatabaseInstaller;component/databaseselection.xaml’ Line 78 Position 3

Solution:
Try to install this msi  using the user who has installed the SQL server 2008 on the machine. You will be able to install this without any issue.

Sunday, September 23, 2012

Why Linq to Entity select on view returns a repeat of first record?


The 'sql' query and ‘Linq to sql’ are working fine. But ‘Linq to Entity'  Select on view return a repeat
of the first record.
Reason :
The difference in behavior between LINQ-to-SQL and LINQ-to-Entities is in the underlying mapping strategies of the technologies. LINQ-to-SQL only supports 1:1 mapping with the database objects. Entity Framework supports multiple entity associations in the conceptual model, and entities are not restricted to a 1:1 mapping with the underlying data objects.

This problem has occurred for me when the view entity does not have a clear primary key which EF wants. If you look at your edmx after adding the view entity to the designer you will probably notice that there are several columns (incorrectly) chosen by EF as the surrogate key.

If you have a primary/surrogate unique key make sure those column(s) are the only ones selected as the view’s key.

Otherwise, if no such key exists, add a uniqueidentifer column to your view using newid() function. Delete and add the view back to your edmx designer. Then on the designer, unselect all the other columns chosen as the key and select the pseudo column added to the view as the unique key.

One annoying thing is that any time you change the view and re-add the view entity back to the designer you likely will have to re-select the proper key.

Timeout issue with Entity Framework 4.0

When you are using a complex query via Entity Framework 4.0, you will be facing time out issue frequently.
Then you need to specify timeout of the query as below
  public TestEntities() : base("name=TestEntities", "TestEntities")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            //it's supposed to use the timeout of the "underlying provider"
            //because of that set the CommandTimeout property.
            //Each and every time when updating the model, need to add this property value in seconds.
            this.CommandTimeout = 180;
            OnContextCreated();
        }

BizTalk Troubleshooting

  • Error :
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'MY.Orchestration.Client(46b8790f-cf99-d0ce-5443-7b22e01f8a3f)'.
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: 86243d42-5a79-4e88-b051-b9eab96160d2
Shape name:
ShapeId:
Exception thrown from: segment -1, progress -1
Inner exception: Received unexpected message type '' does not match expected type 'http://Microsoft.LobServices.Sap/2007/03/Rfc/#BAPI_EXCHANGERATE_CREATEResponse'.
       
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.PortBinding.VerifyMessage(Envelope env, String typeName, Context cxt, OperationInfo op)
   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBinding.VerifyMessage(Envelope env, String typeName, Context cxt, OperationInfo op)
   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXLogicalPortBinding.VerifyMessage(Envelope env, String typeName, Context cxt, OperationInfo op)
   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTransport(Envelope env, Int32 operationId, Context ctx)
   at Microsoft.XLANGs.Core.Subscription.Receive(Segment s, Context ctx, Envelope& env, Boolean topOnly)
   at Microsoft.XLANGs.Core.PortBase.GetMessageId(Subscription subscription, Segment currentSegment, Context cxt, Envelope& env, CachedObject location)
   at MY.Test.segment2(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp 
Solution:
Go to the Send port & change the send pipeline to correct one
  • Error :
The adapter failed to transmit message going to send port "SendToDesk" with URL "C:\ DropFile\%SourceFileName%". It will be retransmitted after the retry interval specified for this Send Port. Details:"The FILE send adapter cannot open file C:\DropFile\Test.csv for writing.
Details: The file exists.

     Solution:
Change Copy mode to “Overwrite” under File Adapter transport properties.
  • Error :
The receive location "BizTalkDebatching_1.0.0.0_BizTalkDebatching.XPathSample_LargeMsgRecPort_a5d2935b60d898e2_ReceiveLocation" with URL "C:\In\*.xml" is shutting down. Details:"The FILE receive adapter cannot monitor receive location C:\In\. ".
    Solution:
Receive folder has been deleted or not available
  • Error :
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'MY.Orchestration. Client(46b8790f-cf99-d0ce-5443-7b22e01f8a3f)'.
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: d21e23a1-af25-4ab8-ac64-dd56f3533b7d
Shape name: Send_2
ShapeId: 5fe691c8-de81-4dbb-a6d0-6f6c2b97d2dd
Exception thrown from: segment 1, progress 69
Inner exception: Exception occurred when persisting state to the database.
       
Exception type: PersistenceException
Source: Microsoft.XLANGs.BizTalk.Engine
Target Site: Void Commit()
The following is a stack trace that identifies the location where the exception occured

   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXXlangStore.Commit()
   at Microsoft.XLANGs.Core.Service.Persist(Boolean dehydrate, Context ctx, Boolean idleRequired, Boolean finalPersist, Boolean bypassCommit, Boolean terminate)
   at Microsoft.XLANGs.Core.LongRunningTransaction.PendingCommit(Boolean ignore, XMessage msg)
   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.SendMessage(Int32 iOperation, XLANGMessage msg, Correlation[] initCorrelations, Correlation[] followCorrelations, Context cxt, Segment seg, ActivityFlags flags)
   at MY.Client.segment1(StopConditions stopOn)
   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Additional error information:

        A batch item failed persistence Item-ID 9e50fa72-5f37-4add-80c3-11d7d86d0a6d OperationType MAIO_CommitBatch Status -1061151960 ErrorInfo An error occurred when accessing the part data or one of its fragments. The part data or fragment may not exist in the database. .
       
Exception type: PersistenceItemException
Additional error information:

        Failed to publish (send) a message in the batch. This is usually because there is no one expecting to receive this message.  The error was An error occurred when accessing the part data or one of its fragments. The part data or fragment may not exist in the database.  with status -1061151960.
       
Exception type: PublishMessageException

Solution:
Test the Mapper using Test Map (reason the Mapper got failed at validation )
  • Error :
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'MY.Test(f9990179-a4eb-c15d-2f28-56241cc0c197)'.
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: baf6446b-0f05-4435-88f2-15487237cbee
Shape name: ConstructMessage_ExchangeListRequest
ShapeId: 90c1630b-3199-4ad2-9ece-12a1eea00be2
Exception thrown from: segment 1, progress 6
Inner exception: The remote server returned an error: (407) Proxy Authentication Required.
       
Exception type: WebException
Source: MY.Utilities
Target Site: System.Xml.XmlDocument GetExchangeRates(System.String)
The following is a stack trace that identifies the location where the exception occured

   at MY. Rates(String day)
   at MY..Process.segment1(StopConditions stopOn)
   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
Solution:
Add below to the BizTalk.config


<system.net>
    <defaultProxy useDefaultCredentials="true">
      <proxy usesystemdefault="True" />
    </defaultProxy>
  </system.net>
<system.net>
                                <defaultProxy enabled="true"/>
                </system.net>
                <system.web>
                                <identity impersonate="true" />
                </system.web>

  • Error :
This is common error for passing wrong request to the service
Exception thrown from: segment -1, progress -1
Inner exception: Received unexpected message type 'http://schemas.xmlsoap.org/soap/envelope/#Fault' does not match expected type 'http://schemas.myl.com.au/11/2009#DataResponse'.
       
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 occurred
Solution:
Not passing request parameters correctly. To find the correct error go to the suspend message & see message body.  You can see the correct error in the message body
Ex : 
<s:Fault xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:DeserializationFailed</faultcode><faultstring xml:lang="en-AU">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.my.com.au/SampleMethod. The InnerException message was 'Invalid enum value '' cannot be deserialized into type 'MY.Test.SampleMethod'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'.  Please see InnerException for more details.</faultstring><detail><ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><HelpLink i:nil="true" /><InnerException><HelpLink i:nil="true" /><InnerException i:nil="true" /><Message>Invalid enum value '' cannot be deserialized into type 'MY.Test.SampleMethod'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.</Message><StackTrace>   at System.Runtime.Serialization.EnumDataContract.ReadEnumValue(XmlReaderDelegator reader)
   at System.Runtime.Serialization.EnumDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract&amp; dataContract)
   at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)
   at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
   at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
   at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)</StackTrace><Type>System.Runtime.Serialization.SerializationException</Type></InnerException><Message>The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://schemas.my.com.au/Test:SampleMethod. The InnerException message was 'Invalid enum value '' cannot be deserialized into type 'MY.Test.SampleMethod'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'.  Please see InnerException for more details.</Message><StackTrace>   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameter(XmlDictionaryReader reader, PartInfo part, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><Type>System.ServiceModel.Dispatcher.NetDispatcherFaultException</Type></ExceptionDetail></detail></s:Fault>

  • Error :
When publishing new web service as an orchestration the following error comes
There are no orchestrations with public receive ports in this BizTalk assembly
Solution:
Click back and specify a BizTalk assembly containing orchestrations with public receive ports

  • Error :
A message sent to adapter "WCF-SAP" on send port "WcfSendPort_SAPBinding_Rfc_Custom" with URI "sap://CLIENT=xxx;LANG=EN;@A/SAP.my.com/00?RfcSdkTrace=False&AbapDebug=False" is suspended.
 Error details: System.ServiceModel.CommunicationException: The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

Server stack trace:
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
 MessageId:  {ADB2D8F5-B493-42F9-8E97-F8654742213A}
 InstanceID: {C09C3341-3F03-4C88-94E7-B4E541149611}
Solution:
SAP Server Down
  • Error
The adapter failed to transmit message going to send port "WcfSendPort_SqlAdapterBinding_Multiple_Custom" with URL "mssql://SqlServer/test /A++?". It will be retransmitted after the retry interval specified for this Send Port. Details:"System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The MSDTC transaction manager was unable to push the transaction to the destination transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02A)
   at System.Transactions.Oletx.ITransactionShim.Export(UInt32 whereaboutsSize, Byte[] whereabouts, Int32& cookieIndex, UInt32& cookieSize, CoTaskMemHandle& cookieBuffer)
   at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
   --- End of inner exception stack trace ---
Server stack trace:
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)".
The adapter failed to transmit message going to send port "WcfSendPort_SqlAdapterBinding_Multiple_Custom" with URL "mssql://SqlServer/test /A++?". It will be retransmitted after the retry interval specified for this Send Port. Details:"System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException: The MSDTC transaction manager was unable to push the transaction to the destination transaction manager due to communication problems. Possible causes are: a firewall is present and it doesn't have an exception for the MSDTC process, the two machines cannot find each other by their NetBIOS names, or the support for network transactions is not enabled for one of the two transaction managers. (Exception from HRESULT: 0x8004D02A)
   at System.Transactions.Oletx.ITransactionShim.Export(UInt32 whereaboutsSize, Byte[] whereabouts, Int32& cookieIndex, UInt32& cookieSize, CoTaskMemHandle& cookieBuffer)
   at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
   --- End of inner exception stack trace ---
Server stack trace:
   at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
   at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)".
Solution:
DTC issue. Check the DTC security options of two machines.
  • Error 
The adapter "SQL" raised an error message. Details "Could not load file or assembly 'Microsoft.Data.SqlXml, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.".
Solution:
SQLXML 4.0 with Service Pack 1
  • Error 
This error comes sometimes 
xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'MY.Client(46b8790f-cf99-d0ce-5443-7b22e01f8a3f)'.
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: 44855170-9b7a-44a7-8584-70fd6d0f2021
Shape name: GetSingleRate
ShapeId: d475b5bb-ecf1-4728-8049-529803ff8d0b
Exception thrown from: segment 1, progress 37
Inner exception: Object reference not set to an instance of an object.
       
Exception type: NullReferenceException
Source: MY.Orchestration
Target Site: Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions)
The following is a stack trace that identifies the location where the exception occured

   at MY.Client.segment1(StopConditions stopOn)
   at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)

Solution:
Problem with message assignment. So the better way is

  xmlList = new System.Xml.XmlDocument();
xmlList = RateListSchemaMessage;

// Get a specific node based on the loop count
XPathValue = System.String.Format("//Rates[{0}]", LoopCount);
XmlDoc = new System.Xml.XmlDocument();
xmlNodeValue = xmlList.SelectSingleNode(XPathValue);
// Set the node to an XmlDocument
XmlDoc.LoadXml(xmlNodeValue.OuterXml);

// Set the XML back to a Message to be sent out
SingleXML = XmlDoc;
 
  • Error
When you assign like below , you will get an "illegal dot name" and OutXml function can't be recognized.

NewXml = new System.Xml.XmlDocument();
NewXml=MessageReq;
TestStr="/*[local-name()='Root' and namespace-uri()='http://TestDebatch.SchemaReq']/*[local-name()='DATASOURCES' and namespace-uri()='']["+count+"]";
NewXmlTem = new System.Xml.XmlDocument();
NewXmlTem.LoadXml(NewXml.SelectSingleNode(TestStr).OuterXml);

Solution:

The XMLNode is non-serializable, so it can only be created in atomic scope. Add a scope shape and set its property to atomic scope and add your expression shape and other related shapes in that atomic scope. Please see the reasoning of limitation of serializable variable in orchestrations below:
Why does the compiler require my variable to be serializable?
The XLANGs runtime may persist to the database (dehydrate) your orchestration, including all of its data, at any point (except in the atomic scope). When the orchestration dehydrates and rehydrates, user-defined variables are binary serialized and deserialized. In most cases, you need a serializable object. A non-serializable object can only be declared and used in an atomic scope. The XLANGs compiler gives you compilation errors if you try to use a non-serializable data type outside of an atomic scope.

  • Error
Could not load file or assembly 'MY.Utilities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=75781fbfe6871f6e' or one of its dependencies. The system cannot find the file specified.
       
Exception type: FileNotFoundException
Source: mscorlib
Target Site: System.Reflection.RuntimeAssembly _nLoad(System.Reflection.AssemblyName, System.String, System.Security.Policy.Evidence, System.Reflection.RuntimeAssembly, System.Threading.StackCrawlMark ByRef, Boolean, Boolean, Boolean)
The following is a stack trace that identifies the location where the exception occured

Solution:

Assembly is not in the GAC 
GacUtil /i My.Utilities\bin\Debug\'MY.Utilities.dll /f