Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 827477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:34:51+00:00 2026-05-15T03:34:51+00:00

I am just trying with various WCF(in .Net 3.0) scenarios. I am using self

  • 0

I am just trying with various WCF(in .Net 3.0) scenarios.

I am using self hosting.

I am getting an exception as “Service ‘MyServiceLibrary.NameDecorator’ has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.”

I have a config file as follows (which has an endpoint)

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.serviceModel>
    <services>

      <service name="Lijo.Samples.NameDecorator"
               behaviorConfiguration="WeatherServiceBehavior">

        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8010/ServiceModelSamples/FreeServiceWorld"/>
          </baseAddresses>
        </host>

        <endpoint address=""
                  binding="wsHttpBinding"
                  contract="Lijo.Samples.IElementaryService" />
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WeatherServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

And a Host as

using System.ServiceModel;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.Runtime.Serialization;

namespace MySelfHostConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            System.ServiceModel.ServiceHost myHost = new ServiceHost(typeof(MyServiceLibrary.NameDecorator));
            myHost.Open(); 
            Console.ReadLine();
        }
    }


}

My Service is as follows

using System.ServiceModel;
using System.Runtime.Serialization;

namespace MyServiceLibrary
{
    [ServiceContract(Namespace = "http://Lijo.Samples")]
    public interface IElementaryService
    {
        [OperationContract]
        CompanyLogo GetLogo();
    }

    public class NameDecorator : IElementaryService
    {
        public CompanyLogo GetLogo()
        {

            CircleType cirlce = new CircleType();
            CompanyLogo logo = new CompanyLogo(cirlce);
            return logo;
        }
    }

    [DataContract]
    public abstract class IShape 
    {
        public abstract string SelfExplain();

    }

    [DataContract(Name = "Circle")]
    public class CircleType : IShape 
    {
        public override string SelfExplain()
        {
            return "I am a Circle";
        }
    }

    [DataContract(Name = "Triangle")]
    public class TriangleType : IShape
    {
        public override string SelfExplain()
        {
            return "I am a Triangle";
        }
    }

    [DataContract]
    [KnownType(typeof(CircleType))]
    [KnownType(typeof(TriangleType))]
    public class CompanyLogo
    {
        private IShape m_shapeOfLogo;

        [DataMember]
        public IShape ShapeOfLogo
        {
            get
            {
                return m_shapeOfLogo;
            }
            set
            {
                m_shapeOfLogo = value;
            }
        }

        public CompanyLogo(IShape shape)
        {
            m_shapeOfLogo = shape;
        }
    }

}

Could you please help me to understand what I am missing here?

Thanks

Lijo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:34:52+00:00Added an answer on May 15, 2026 at 3:34 am

    You’re self-hosting in a console app – how is your config set up??

    • Does your MySelfHostConsoleApp project have an app.config file?

    • Do you have the MySelfHostConsoleApp.exe.config in the same directory as the MySelfHostConsoleApp.exe file?

    The error message just really means the config cannot be found and thus cannot be interpreted and used.

    UPDATE: the other option is that WCF cannot interpret the config if it’s present.

    Check this out:

    • in your .NET code, your service class that implements the service is called MyServiceLibrary.NameDecorator

    • however, in your config, you call your service:

      <service name="Lijo.Samples.NameDecorator"
      

    That’s not going to work! You’re mixing up the .NET namespaces and the service namespaces here – and the name you need to put in your service-side config is the .NET fully qualified type name (including the .NET namespace – not the service namespace!).

    Your service host will look for an entry <service name="MyServiceLibrary.NameDecorator"> based on your code – but it won’t find it.

    So you need to make sure to sync those two things up – the fully qualified service class name (including namespace and all) MUST match the name="...." attribute in your <service> tag in your config.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since two days I am trying to consume a WCF (.NET) Soap Service and
I am just trying to get my head around various pointer concepts and I
just trying to test for equality in this piece of code, but getting a
I am trying the simple senario of running a WCF service to return Active
I am just trying to draw a simple pie chart using flotr(an open source
I am trying to import various pipe delimited files using php 5.2 into a
I am trying to generate excel file using various currencies. This works fine public
I'm trying to run a WCF ServiceHost as an NT Service on a Windows
Just trying to get diff to work better for certain kinds of documents. With
Just trying to still get my head around IOC principles. Q1: Static Methods -

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.