Could not find a base address error in WCF


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.
    public class Eval
        public string Submitter;
        public DateTime Timesent;
        public string Comments;


    public interface IEvalService 
        void SubmitEval(Eval eval);
        List<Eval> GetEvals();
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
    public class EvalService : IEvalService
        List<Eval> evals = new List<Eval>();
        public void SubmitEval(Eval 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));
                new BasicHttpBinding(),
                new WSHttpBinding(),
                new NetTcpBinding(),
            catch (Exception e)

Open in new window

App.config on the service side:
    <compilation debug="true" />
  <!-- 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. -->
      <service name="EvalServiceLibrary.EvalService">
            <add baseAddress = "http://localhost:8733/Design_Time_Addresses/EvalServiceLibrary/Service1/" />
        <!-- 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 
            <dns value="localhost"/>
        <!-- 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"/>

Open in new window

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

Open in new window

Thank you so much.
Who is Participating?

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

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.

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

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

From novice to tech pro — start learning today.