I am able to add messages to local MSMQ using nservicebus by below code
var endpointConfiguration = new EndpointConfiguration("Samples.Msmq.Simple");
var transport = endpointConfiguration.UseTransport<MsmqTransport>();
endpointConfiguration.SendFailedMessagesTo("error");
endpointConfiguration.EnableInstallers();
endpointConfiguration.UsePersistence<InMemoryPersistence>();
var endpointInstance = await Endpoint.Start(endpointConfiguration)
.ConfigureAwait(false);
var myMessage = new MyMessage();
await endpointInstance.SendLocal(myMessage)
.ConfigureAwait(false);
But I read at some places that I can send messages to remote MSMQ, see code below
FormatName:Direct=TCP:100.100.100.12\\private$\\remoteTxn
But I am not able to figure how to send to Remote MSMQ using Nservicebus. Anyone can pitch here?