Search code examples
wpfmsdtc

Restarting the MSDTC service from a wpf app


MSDTC service keeps shutting it self down when using multiple entity framework data models. The only solution is to manually restart the MSDTC service, how can I restart the service using c# in a wpf application?

Thanks


Solution

  • MSDTC runs as a regular Windows service under the name "Distributed Transaction Coordinator". You can stop and start it using the ServiceController class (using System.ServiceProcess).