public void Execute(IBaseMessageContext context) { context.EnsureFileOutboundTransport(); var outboundTransportLocation = context.GetProperty(BtsProperties.OutboundTransportLocation); var rootPath = Path.GetDirectoryName(outboundTransportLocation); if (rootPath.IsNullOrEmpty() && IO.Path.IsNetworkPath(outboundTransportLocation)) { var fileName = Path.GetFileName(outboundTransportLocation); if (!fileName.IsNullOrEmpty()) { rootPath = outboundTransportLocation.Remove(outboundTransportLocation.Length - fileName.Length); } } if (rootPath.IsNullOrEmpty()) { throw new InvalidOperationException("Root path was expected to be found in BtsProperties.OutboundTransportLocation context property."); } var subPathAndFile = context.GetProperty(BizTalkFactoryProperties.OutboundTransportLocation); if (subPathAndFile.IsNullOrEmpty()) { throw new InvalidOperationException( "Target sub path and file name were expected to be found in BizTalkFactoryProperties.OutboundTransportLocation context property."); } context.SetProperty(BtsProperties.OutboundTransportLocation, Path.Combine(rootPath !, subPathAndFile)); }