MassTransit/MassTransit — Issue #52: Exception while disposing ServiceBus on mono
Author: seif
Created: 2011-12-05 18:23:36+00:00
State: open

Running the starbucks sample using rabbitmq on ubuntu 11.10 with mono 2.10.5 throws an exception because the method is not implemented in mono:

https://github.com/mono/mono/blob/master/mcs/class/System/System.Diagnostics/PerformanceCounter.cs#L380

Exception details:
System.NotImplementedException: The requested feature is not implemented.
at System.Diagnostics.PerformanceCounter.RemoveInstance () [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.Diagnostics.PerformanceCounter:RemoveInstance ()
at MassTransit.Monitoring.InstancePerformanceCounter.Close () [0x00000] in :0
at MassTransit.Monitoring.InstancePerformanceCounter.Dispose (Boolean disposing) [0x00000] in :0
at MassTransit.Monitoring.InstancePerformanceCounter.Dispose () [0x00000] in :0
at MassTransit.Monitoring.ServiceBusInstancePerformanceCounters.Close () [0x00000] in :0
at MassTransit.Monitoring.ServiceBusInstancePerformanceCounters.Dispose (Boolean disposing) [0x00000] in :0
at MassTransit.Monitoring.ServiceBusInstancePerformanceCounters.Dispose () [0x00000] in :0
at MassTransit.ServiceBus.Dispose (Boolean disposing) [0x00000] in :0
at MassTransit.ServiceBus.Dispose () [0x00000] in :0
at Starbucks.Barista.BaristaService.Stop () [0x00000] in :0

This isn't an issue with MassTransit per say, but would be nice to work around it somehow, as it seems to stop the service from exiting properly when running in mono.