生成References.cs后,从AppSettings默认读取服务Uri

时间:2013-03-08 21:54:27

标签: service web appsettings

问题与更新Web服务时生成代码有关。 当我更新web referenc所以它生成文件References.cs。有一个服务类,它有构造函数,可以从:

读取有关url的设置

 this.Url = global :: <projectNamespace>. Properties.Settings.Default.MyServiceName;

在References.cs生成后,我手动将其更改为:

this.Url System.Configuration.ConfigurationManager.AppSettings["MyServiceName"];

有没有办法生成一个默认构造函数,它将从AppSettings中读取?

例如使用SchemaImporterExtension?

0 个答案:

没有答案
相关问题