Could not find a base address error in WCF

Hi,

I am really new to WCF and I tried to build custom host application.
However, I am getting "An unhandled exception of type 'System.InvalidOperationException' occurred in System.ServiceModel.dll.
Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are[]."
This is my service side of code.
    [DataContract]
    public class Eval
    {
        [DataMember]
        public string Submitter;
        [DataMember]
        public DateTime Timesent;
        [DataMember]
        public string Comments;

    }

    [ServiceContract]
    public interface IEvalService 
    {
        [OperationContract]
        void SubmitEval(Eval eval);
        [OperationContract]
        List<Eval> GetEvals();
    }
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
    public class EvalService : IEvalService
    {
        List<Eval> evals = new List<Eval>();
        public void SubmitEval(Eval eval)
        {
            evals.Add(eval);
        }

        public List<Eval> GetEvals()
        {
            return evals;
        }
    }

Open in new window

My ConsoleHost program has the following code.
namespace ConsoleHost
{
    class Program
    {
        static void Main(string[] args)
        {
            ServiceHost host = new ServiceHost(typeof(EvalService));
            host.AddServiceEndpoint(typeof(IEvalService), 
                new BasicHttpBinding(),
                "http//localhost:8/evals/basic");
            host.AddServiceEndpoint(typeof(IEvalService),
                new WSHttpBinding(),
                "http//localhost:8080/evals/ws");
            host.AddServiceEndpoint(typeof(IEvalService),
                new NetTcpBinding(),
                "net.tcp//localhost:8081/evals");
            try
            {
                host.Open();
                Console.Read();
                host.Close();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                host.Abort();
            }
        }
    }
}

Open in new window

App.config on the service side:
<system.web>
    <compilation debug="true" />
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's 
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <services>
      <service name="EvalServiceLibrary.EvalService">
        <host>
          <baseAddresses>
            <add baseAddress = "http://localhost:8733/Design_Time_Addresses/EvalServiceLibrary/Service1/" />
          </baseAddresses>
        </host>
        <!-- Service Endpoints -->
        <!-- Unless fully qualified, address is relative to base address supplied above -->
        <endpoint address="" binding="basicHttpBinding" contract="EvalServiceLibrary.IEvalService">
          <!-- 
              Upon deployment, the following identity element should be removed or replaced to reflect the 
              identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
              automatically.
          -->
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <!-- Metadata Endpoints -->
        <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> 
        <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>

Open in new window


App.config from ConsoleHost project
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
</configuration>

Open in new window


Thank you so much.
IzzyTwinklyAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

srikanthreddyn143Commented:
You missed colon in the end point while adding host.
http ":" //localhost:8/evals/basic

Adding colon fixes the error you mentioned. But, you may still get metadata errors.

Refer to below link on how to self host a WCF service
http://www.codeproject.com/Articles/650869/Creating-a-Self-Hosted-WCF-Service

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.