svcutil.exe issue with configuration name

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

svcutil.exe issue with configuration name

diptidjadhav
I am updating my wcf service reference through SvcUtil.exe using NAnt.
command is as follows:

<target name="generate-proxy" description="generates proxy class for webservice">               
                <exec program="../ApplicationLibrary/SvcUtil.exe" >               
                        <arg value="http://localhost:50886/Service1.svc" /> 
                        <arg value="/o:Service References\ServiceReference1\Reference.cs" /> 
                        <arg value="/n:*,ClassLibrary1.ServiceReference1" />
                        <arg value="/ct:System.Collections.Generic.List`1, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>                       
                        <arg value="/config:app.config"/>
                </exec>
        </target>



SvcUtil.exe http://localhost:50886/Service1.svc /n:*,ClassLibrary2.ServiceReference1 /o:Service References\ServiceReference1\Reference.cs /ct:System.Collections.Generic.List`1, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 /config:app.config

And my wcf code is as follows:

==============================================================

    namespace WcfService1
    {
        [ServiceContract]
        [ServiceKnownType(typeof(Dictionary<string, string>))]
        public interface IService1
        {
            [OperationContract]
            string GetData(int value);
            // TODO: Add your service operations here
            [OperationContract]
            string Hello(string value);
        }
    }



    namespace WcfService1
    {

        [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
        [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

        public class Service1 : IService1
        {
            public string GetData(int value)
            {
                return string.Format("You entered: {0}", value);
            }

            public string Hello(string value)
            {
                return string.Format("You entered: {0}", value);
            }
        }
    }


I am using this service in my class library project which name is ClassLibrary1. When i am updating this service through visual studio then in Reference.cs I got following statement:

    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ServiceReference1.IService1")]
    public interface IService1

But when m updating service through svcutil then I got following statement:

    [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ClassLibrary2.ServiceReference1.IService1")]
    public interface IService1

The difference is configuration name. I didn't understand which command should i used in svcutil to set configuration name just as ServiceReference1.IService1 ?

Please help.
Loading...