How to set a namespace without overwriting the service configuration name using SvcUtil.exe?

I use SvcUtil.exe to generate my WCF code, for example:

SvcUtil.exe http://www.MyServer.com:8080/MyService/mex /out:"C:\test.cs" /mc

I can make it work, but if I add the argument /namespace( /namespace:*,MyNamespace), it will overwrite the value ConfigurationNamein the generated ServiceContractAttributecreated interface:

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="MyNamespace.MyServiceName")]
public interface MyServiceName
{ ... }

If I do not set the namespace, the value ConfigurationNameis "MyServiceName" which is correct ("MyNamespace.MyServiceName" is incorrect and does not work). I tried adding the argument / ServiceName: MyService, but it tells me what it says

Error: option / serviceName: conflicts with other options. Review your use of the tool.

ConfigurationName?

+5
2

. ServiceReference, ConfigurationName = "MyWebService.MyWebServiceSoap", , VisualStudio.NET 2010. svcutil msbuild, svcutil ConfigurationName . , /n :

/n:*,MyApplication.MyWebService.MyWebServiceSoap

, ConfigurationName MyApplication.MyWebService.MyWebServiceSoap.

, -, , VS.NET svcutil, . , .

, , svcutil MSBuild, svcutil ConfigurationName, FileUpdate . , , svcutil, _.

, , serviceName , -, , , , serviceName.

: http://msdn.microsoft.com/en-us/library/aa347733.aspx

+8

, , , , , , .

/-

 <client>
    <endpoint .. contract="MyServiceName">
    </endpoint>
 </client>

contract. svcutil, MyServiceName, web.config . , :

 <client>
    <endpoint .. contract="MyNamespace.MyServiceName">
    </endpoint>
 </client>

, ConfigurationName contract config. , .

+2

All Articles