I'm using SvcUtil.exe to generate my WCF code, like this:
SvcUtil.exe http://www.MyServer.com:8080/MyService/mex /out:"C:\test.cs" /mc
I can get it to work, but if I set add a /namespace
argument(/namespace:*,MyNamespace
), it overwrites the ConfigurationName
value on the generated ServiceContractAttribute
of the generated interface:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="MyNamespace.MyServiceName")]
public interface MyServiceName
{ ... }
If I don't set the namespace, the value of ConfigurationName
is "MyServiceName", which is correct ("MyNamespace.MyServiceName" is incorrect and does not work). I've tried adding a /ServiceName:MyService argument, but it tells me that it says
Error: The /serviceName: option conflicts with other options. Review your use of the tool.
How can I specify a namespace for my generated classes without overwriting the ConfigurationName?