2009-12-18 21 views
9

पर विफल होती है मेरे पास एक विंडोज सेवा में होस्ट की गई डब्ल्यूसीएफ सेवा है जिसे मैं स्वचालित पर सेट करता हूं ताकि सर्वर को लाया जाने पर यह स्वचालित रूप से प्रारंभ हो जाए। सेवा एंडपॉइंट है एमएसएमक्यू समर्थित है।एमएसएमक्यू समर्थित विंडोज़ सेवा में होस्ट की गई डब्ल्यूसीएफ सेवा स्टार्टअप

जब मैं मैन्युअल रूप से सेवा शुरू करता हूं, तो सब कुछ अच्छा होता है। पहले सेवा शुरू होता है इस्तेमाल किया जा करने के लिए तैयार

System.TypeInitializationException: The type initializer for 
'System.ServiceModel.Channels.Msmq' threw an exception. ---> 
System.ServiceModel.MsmqException: The version check failed with the error: 
'The Message Queuing service is not available (-1072824309, 0xc00e000b)'. The 
version of MSMQ cannot be detected All operations that are on the queued channel 
will fail. Ensure that MSMQ is installed and is available. 
    at System.ServiceModel.Channels.MsmqQueue.GetMsmqInformation 
        (Version& version, Boolean& activeDirectoryEnabled) 
    at System.ServiceModel.Channels.Msmq..cctor() 
    --- End of inner exception stack trace --- 

यह MSMQ की तरह लगता है है नहीं ... वहाँ इस के लिए एक समाधान है: लेकिन जब सेवा bootup पर शुरू होता है, मैं एक MSMQ अपवाद मिल सकता है?

उत्तर

7

आपको अपने डब्ल्यूसीएफ सेवा होस्ट में एमएसएमक्यू पर निर्भरता जोड़ने की जरूरत है। आप सेवा संस्थापक में ऐसा कर सकते हैं: आप एक सेवा इंस्टॉलर का उपयोग नहीं कर रहे हैं

ServiceInstaller serviceInstaller = new ServiceInstaller(); 
// Adding this property to your ServiceInstaller forces 
// your service to start after MSMQ. 
serviceInstaller.ServicesDependedOn = new string[] { "MSMQ" }; 

, आप भी MSMQ निर्भरता आपकी सेवा के लिए संपादन Windows रजिस्ट्री द्वारा, "Microsoft Support: How to delay loading of specific services" में बताए अनुसार जोड़ सकते हैं।

+0

धन्यवाद! google'ing कि अपवाद संदेश फलहीन साबित हुआ! – puffpio