次のように、SvcUtil.exe を使用して WCF コードを生成しています。
SvcUtil.exe http://www.MyServer.com:8080/MyService/mex /out:"C:\test.cs" /mc
動作させることはできますが、add a /namespace
argument( ) を設定すると、生成されたインターフェイスの生成された値が/namespace:*,MyNamespace
上書きされます。ConfigurationName
ServiceContractAttribute
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="MyNamespace.MyServiceName")]
public interface MyServiceName
{ ... }
名前空間を設定しない場合、値ConfigurationName
は正しい "MyServiceName" になります ("MyNamespace.MyServiceName" は正しくなく、機能しません)。/ServiceName:MyService 引数を追加しようとしましたが、次のように表示されます
エラー: /serviceName: オプションが他のオプションと競合しています。ツールの使用状況を確認します。
ConfigurationName を上書きせずに、生成されたクラスの名前空間を指定するにはどうすればよいですか?