I’m new to NSB. Using trial version licence.
In MVC controller method I’ve coded endpoint configuration and start the endpoint. It’s working fine if I debug the MVC appliction but am getting error once deployed the application on IIS.
“The type initializer for ‘NServiceBus.PersistenceStartup’ threw an exception”
Code
[HttpGet]
public async Task Process(int id)
{
var endpointConfiguration = new EndpointConfiguration("Client");
endpointConfiguration.EnableInstallers();
endpointConfiguration.UsePersistence<InMemoryPersistence>();
endpointConfiguration.UseTransport<MsmqTransport>();
endpointConfiguration.SendFailedMessagesTo("ClientError");
var endpointInstance = await Endpoint.Start(endpointConfiguration)
.ConfigureAwait(false);
await endpointInstance.Send("Server", <OBJ>)
.ConfigureAwait(false);
await endpointInstance.Stop()
.ConfigureAwait(false);
return Ok("Ok");
}