2011-04-06 38 views
1

.NET Framework 3.5を使用してWindowsサービスを開発しています。リモートマシン上でWebサービスを呼び出す必要があり、私は奇妙なインストールの問題に遭遇しています。ユーザーとしてWindowsサービスをインストールできない

これは私のマシンにUser(デフォルト)という名前でインストールしていましたが、ログインとパスワードの入力を求めるメッセージが表示され、すべて正常に機能しました。それから、ある時点で、それは動作を停止し、LocalSystemとしてインストールすることがわかり、うまくいきました。

今私は、リモートのWebサービスを呼び出すようにしようとしていると私はWCFからエラーを取得しています:

There was no endpoint listening at https://www.remote.com/webservice.asmx that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. 

どうやら、これはLocalSystemとしてサービスを実行する原因である可能性があります(持っていませんインターネットへのアクセス):There was no endpoint listening at <URI> that could accept the message. This is often caused by an incorrect address or SOAP action

私はサービスをUserとしてインストールし、資格情報を提供することに戻りました(私は自分のマシンの管理者であることに注意してください)。しかし、それは動作しませんし、エラーメッセージ(及びます。installutilログファイルの内容は)無用の隣にある:私の知る限り、関連するビットは、サービスのインストールに失敗したということです言うことができるように

Running a transacted installation. 

Beginning the Install phase of the installation. 
See the contents of the log file for the Service.exe assembly's progress. 
The file is located at Service.InstallLog. 

An exception occurred during the Install phase. 
System.InvalidOperationException: An exception occurred in the OnAfterInstall event handler of System.ServiceProcess.ServiceInstaller. 
The inner exception System.InvalidOperationException was thrown with the following error message: Service ServiceName was not found on computer '.'. 
The inner exception System.ComponentModel.Win32Exception was thrown with the following error message: The specified service does not exist as an installed service. 

The Rollback phase of the installation is beginning. 
See the contents of the log file for the Service.exe assembly's progress. 
The file is located at Service.InstallLog. 

The Rollback phase completed successfully. 

The transacted install has completed. 

。これ以上の情報はありません!サービスがLocalSystemとして正常にインストールされる理由はありますが、AdministratorsグループのメンバーであるUserとしてインストールすると失敗しますか?

答えて

1

NetworkServiceをお試しください。 セキュリティ上の理由から、LocalServiceは外部との接続を許可されていません。

サービスを自分でインストールすることができない理由は、UACが原因である可能性があります。あなたのアカウントの管理者であっても、UACが完全にオフになっていない限り、サービスのインストールは不可能であることが分かりました。これはあなたのアカウントにこの特別な特権がないためです。グループポリシーマネージャでこれを修正できると思います。

+0

NetworkServiceとしてインストールしようとすると、OnAfterInstallにWin32Exceptionがスローされ、次のメッセージが表示されます。アクセスが拒否されました。 –

+0

私は明確にすべきです:私はNetworkServiceユーザーとしてサービスを_run_することを意味しました。特別な権限を持つユーザーとしてインストールする必要があります。 UACはこのマシンでアクティブですか? –

+0

@Jonas:はい、Windows 7のボックスなので、UACが使用されていると思います。私はInstallUtilをVisual Studioコマンドプロンプト(「管理者として実行」で開かれた)で実行しています。私の以前のコメント(NetworkServiceとしてインストールされています)は正しくありません。つまり、ServiceProcessInstallerのAccountプロパティ(つまり、実行するアカウント)はNetworkServiceに設定されています。自動的に起動するように設定されていることにも注意してください(手動で起動するように設定しても同じ問題が発生します)。 –

関連する問題