2011-05-31 3 views
6

का उपयोग कर Windows सेवा स्थापित करने में त्रुटि मुझे मेरी विंडोज सेवा स्थापित करने में कुछ समस्याएं आ रही हैं। Easiest language for creating a Windows serviceInstallUtil.exe

ServiceAccount, उपयोगकर्ता के लिए सेट है, हालांकि मैं LocalService, स्थानीय सिस्टम और NetworkService की कोशिश की है:

मैं अपने सेवा बनाने के लिए यहां मैट के निर्देशों का पालन किया।

मेरी विंडोज सेवा का उद्देश्य मेरी डब्ल्यूसीएफ सेवा के लिए एक होस्ट बनाना है। मैं 7 विन चला रहा हूँ 64-बिट प्रो

मैं डब्ल्यू/व्यवस्थापक privelages PowerShell में निम्नलिखित भाग गया:

Microsoft (R) .NET Framework Installation utility Version 2.0.50727.4927 
Copyright (c) Microsoft Corporation. All rights reserved. 

Running a transacted installation. 

Beginning the Install phase of the installation. 
See the contents of the log file for the H:\<omitted>\Host Windows Service.exe assembly's progress. 
The file is located at H:\<omitted>\Host Windows Service.InstallLog. 
Installing assembly 'H:\<omitted>\Host Windows Service.exe'. 
Affected parameters are: 
    assemblypath = H:\<omitted>\Host Windows Service.exe 
    logfile = H:\<omitted>\Host Windows S 
ervice.InstallLog 
    logtoconsole = 
Unable to create an instance of the Host_Windows_Service.ProjectInstaller installer type. 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. 
The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does no 
t allow partially trusted callers.. 

An exception occurred during the Install phase. 
System.InvalidOperationException: Unable to create an instance of the Host_Windows_Service.ProjectInstaller installer ty 
pe. 
The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception h 
as been thrown by the target of an invocation.. 
The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does no 
t allow partially trusted callers.. 

The Rollback phase of the installation is beginning. 
See the contents of the log file for the H:\<omitted>\Host Windows Service.exe assembly's progress. 
The file is located at H:\<omitted>\Host 
Windows Service.InstallLog. 
Rolling back assembly 'H:\<omitted>\Host Windows Service.exe'. 
Affected parameters are: 
    assemblypath = H:\<omitted>\Host Windows Service.exe 
    logfile = H:\<omitted>\Host Windows Service.InstallLog 
    logtoconsole = 
Unable to create an instance of the Host_Windows_Service.ProjectInstaller installer type. 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. 
The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does no 
t allow partially trusted callers.. 
An exception occurred during the Rollback phase of the System.Configuration.Install.AssemblyInstaller installer. 
System.InvalidOperationException: Unable to create an instance of the Host_Windows_Service.ProjectInstaller installer ty 
pe. 
The inner exception System.Reflection.TargetInvocationException was thrown with the following error message: Exception h 
as been thrown by the target of an invocation.. 
The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does no 
t allow partially trusted callers.. 
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback wil 
l continue. However, the machine might not fully revert to its initial state after the rollback is complete. 

The Rollback phase completed successfully. 

The transacted install has completed. 
The installation failed, and the rollback has been performed. 

मैं भी यूएसी अक्षम करने की कोशिश की:

PS C:\windows\Microsoft.NET\Framework64\v2.0.50727> ./installutil "H:\<omitted>\Host Windows Service.exe" 

मैं निम्न त्रुटि प्राप्त पूरी तरह से कोई किस्मत के साथ। अगर आपको अधिक जानकारी चाहिए तो कृपया मुझे बताएं।

मैं यहां विंडोज सेवा स्थापित करने के लिए मैट की विधि का उपयोग करने के लिए प्रेरित हूं: How to make a .NET Windows Service start right after the installation?। हालांकि, मुझे चिंता है कि मैं इसी तरह की समस्याओं में भाग जाऊंगा।

धन्यवाद

+0

इस सवाल को लिखने का तरीका, यह प्रोग्रामिंग के लिए थोड़ा सा विषय लगता है। इसे बंद करने के लिए मतदान नहीं करना क्योंकि यह पिछले SO प्रश्न से एक उदाहरण से संबंधित है, लेकिन सवाल और शीर्षक में .NET, C#, आदि पर जोर देने का प्रयास करें। –

+0

धन्यवाद @ एजे मैं उम्मीद कर रहा था कि किसी को अपवादों के साथ कुछ अनुभव होगा, और अगर मैं कुछ मूर्खतापूर्ण कर रहा हूं तो मुझे बता सकता है। –

+0

@ रयान आर, आंतरिक अपवाद इसकी सुरक्षा को इंगित करता है, यानी अनुमतियां, समस्या। मैं इस पर एक विशेषज्ञ नहीं हूं, लेकिन यहां एक लिंक है जो प्रासंगिक प्रतीत होता है। http://msdn.microsoft.com/en-us/library/8skskf63.aspx –

उत्तर

3

सेवा और सी के लिए अपनी निर्भरता चलती का प्रयास करें: ड्राइव और फिर से कोशिश कर रहा है, खासकर अगर एच: एक नेटवर्क ड्राइव पर है।

+0

मैं सहमत हूं। नेटवर्क शेयर पर एक असेंबली के साथ InstallUtil का उपयोग करने का प्रयास करते समय मैंने एक ही समस्या में भाग लिया है। काम करने के लिए यूएनसी संदर्भ के बजाय मुझे इसे स्थानीय ड्राइव संदर्भ बनाना पड़ा। –

संबंधित मुद्दे