1
我在使用WSDL.exe工具更新動態Web引用時遇到問題。通過命令行更新動態Web引用(wsdl工具)
當我在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文件?