WSDL.exe ツールを使用して動的 Web 参照を更新する際に問題があります。
VS で「Web 参照の更新」を使用している場合、すべてが期待どおりに機能しています。以下は、生成されたコード (Reference.cs ファイルの一部) です。
public MyService() {
this.Url = global::ServerReference.Properties.Settings.Default.ServerReference_Reference_MyService;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
}
else {
this.useDefaultCredentialsSetExplicitly = true;
}
}
アプリケーションのプロパティから必要な情報を取得しています。この情報は構成ファイルに保存されるため、アプリケーションを再構築せずに変更できます。
ただし、次のコマンドを使用すると:
.\tools\wsdl.exe /l:cs /n:ServerReference /o".\ServerReference\Web References\Reference\Reference.cs" http://localhost:52956/MyService/MyService.asmx
Reference.cs ファイルに固定の URL アドレスで作成されます。
Visual Studioと同じReference.csファイルを実現するためにコマンドを変更する方法を知っている人はいますか?