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 8095423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:07:30+00:00 2026-06-05T21:07:30+00:00

I used this MSDN example to construct my console host app: http://msdn.microsoft.com/en-us/library/ms731758.aspx It works

  • 0

I used this MSDN example to construct my console host app:

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

It works I have a service running, while running I can add it as a Service Reference to my Silverlight class library ViewModel and I can see it running in a browser.

However when I run my Silverlight app I get the following error message:

Could not find default endpoint element that references contract
‘ServiceLayer.IServiceLayer’ in the ServiceModel client configuration
section. This might be because no configuration file was found for
your application, or because no endpoint element matching this
contract could be found in the client element.

This is my service code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.ServiceModel.Activation;
using Model;

namespace ServiceLayer
{
    [ServiceContract(Namespace = "ServiceLayer")] //This has to match references or updating the service reference will not work.
    public interface IServiceLayer
    {
        [OperationContract] //This is needed for each method.
        string Compile(string cscode, string name, string type, int token);

        [OperationContract] //This is needed for each method.
        string LoginClick(string username, string password, bool createuser, int token);

        [OperationContract]
        bool IsLoggedIn(int token);

        [OperationContract] //This is needed for each method.
        object[] GetMessages(int token);

        [OperationContract] //This is needed for each method.
        int GetToken(int token);

        [OperationContract] //This is needed for each method.
        string[][] GetPlugins(int token);

        [OperationContract] //This is needed for each method.
        string Finalize(int token, string[] descriptions);

        [OperationContract] //This is needed for each method.
        object[][] Communicate(string methodName, int token, object[] args);
    }

    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class ServiceLayer : IServiceLayer
    {
        public string Compile(string cscode, string name, string type, int token)
        {
            // Add your operation implementation here
            ModelInterface MI = new ModelInterface();
            return MI.Compile(cscode, name, type, token);
        }

        public String LoginClick(string username, string password, bool createuser, int token)
        {
            ModelInterface MI = new ModelInterface();
            return MI.LoginClick(username, password, createuser, token);
        }

        public bool IsLoggedIn(int token)
        {
            ModelInterface MI = new ModelInterface();
            return MI.IsLoggedIn(token);
        }

        public object[] GetMessages(int token)
        {
            ModelInterface MI = new ModelInterface();
            return MI.GetMessages(token);
        }

        public int GetToken(int token)
        {
            ModelInterface MI = new ModelInterface();
            return MI.GetToken(token);
        }

        public string[][] GetPlugins(int token)
        {
            ModelInterface MI = new ModelInterface();
            return MI.GetPlugins(token);
        }

        public string Finalize(int token, string[] descriptions)
        {
            ModelInterface MI = new ModelInterface();
            return MI.Finalize(token, descriptions);
        }

        public object[][] Communicate(string methodName, int token, object[] args)
        {
            ModelInterface MI = new ModelInterface();
            return MI.Communicate(methodName, token, args);
        }
        // Add more operations here and mark them with [OperationContract]
    }
}

This is the ServiceReferences.ClientConfig of the ViewModel:

<configuration>
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_IServiceLayer" maxBufferSize="2147483647"
                maxReceivedMessageSize="2147483647">
                <security mode="None" />
            </binding>
            <binding name="BasicHttpBinding_IServiceLayer1" maxBufferSize="2147483647"
                maxReceivedMessageSize="2147483647">
                <security mode="None" />
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:3263/front" binding="basicHttpBinding"
            bindingConfiguration="BasicHttpBinding_IServiceLayer" contract="IServiceLayer"
            name="BasicHttpBinding_IServiceLayer" />
        <endpoint address="http://localhost:3263/front" binding="basicHttpBinding"
            bindingConfiguration="BasicHttpBinding_IServiceLayer1" contract="ServiceLayer.IServiceLayer"
            name="BasicHttpBinding_IServiceLayer1" />
    </client>
</system.serviceModel>

And this is the Web.Config file of the project with the website hosting the Silverlight app.
I post it because I tried this Could not find default endpoint element
guide – ie copying the servicemodel section from the VM config to the web.Config below also:

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
    <pages controlRenderingCompatibilityVersion="4.0"/>
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <customBinding>
        <binding name="OrgOS.Web.ServerCommunicationService.customBinding0">
          <binaryMessageEncoding/>
          <httpTransport/>
        </binding>
        <binding name="OrgOS.Web.ServiceLayer.customBinding0">
          <binaryMessageEncoding/>
          <httpTransport/>
        </binding>
      </customBinding>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
    <services>
      <service name="OrgOS.Web.ServiceLayer">
        <endpoint address="" binding="customBinding" bindingConfiguration="OrgOS.Web.ServiceLayer.customBinding0" contract="OrgOS.Web.ServiceLayer"/>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

My server I rented came without ASP.NET despite the fact I paid for it, support is on leave and I have deadlines coming up!
Trying to get WCF working is driving me mad – please help me…

Why is it so freaking hard to show a simple Silverlight project…

  • 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-06-05T21:07:33+00:00Added an answer on June 5, 2026 at 9:07 pm

    Ah nevermind; you have to post the config settings in both the View Silverlight project, the web project AND the ViewModel Silverlight project.

    You must also delete all endpoints and bindings, but one to avoid getting things confused.

    Also changed things to make sure namespace=”namespace” fits the actual namespace.

    … not that things work for that reason, oh noes all I get is invalid results.

    FML right now.

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

Sidebar

Related Questions

I have used code like this: http://msdn.microsoft.com/en-us/library/dw70f090.aspx to access database before when working in
I used this white paper from MS for reference: http://msdn.microsoft.com/en-us/library/ms345117(v=sql.90).aspx However I get an
http://msdn.microsoft.com/en-us/library/system.web.mvc.httpdeleteattribute.aspx Represents an attribute that is used to restrict an action method so that
I checked the code example at http://msdn.microsoft.com/en-us/library/dd728281.aspx#Y0 , and found one interesting thing: if
I am aware of formatted DataContract names, as described here: http://msdn.microsoft.com/en-us/library/ms731045.aspx (Customizing Data Contract
It is said here http://msdn.microsoft.com/en-us/library/fa13yay7%28v=VS.90%29.aspx (see also http://msdn.microsoft.com/en-us/library/s4wcexbc%28VS.90%29.aspx ) Use this option if you
I'm struggling with compile error C3200 http://msdn.microsoft.com/en-us/library/3xwxftta.aspx discusses the problem and gives as an
I used this example (http://reecon.wordpress.com/2010/04/25/uploading-files-to-http-server-using-post-android-sdk/) to upload file from android device to server, it
I've a must to create wcf service with parameter. I'm following this http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/8f18aed8-8e34-48ea-b8be-6c29ac3b4f41 First
Using code blocks or Dispose method hasn't used in this MSDN example about dialog

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.