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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:08:32+00:00 2026-06-09T04:08:32+00:00

like the title says, I want to keep my logic in a separate project

  • 0

like the title says, I want to keep my logic in a separate project to the service contract(s) so this can stay separate and hidden. I’ve seen it said that this can be done, but I can’t find any examples as to how.

I moved all the necessary code out to a different project, but when I test it only the types are visible to the client, not the methods.

All the methods are marked as [OperationContract] in the interface.

I’m guessing there must be a way of specifically connecting the implementation logic to the contract other than just Class : IInterface, otherwise, what would happen if there were 2 similar classes, e.g.: Class1 : IInterface and Class2 : IInterface? How would WCF know which class to use?

  • 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-09T04:08:34+00:00Added an answer on June 9, 2026 at 4:08 am

    How would WCF know which class to use?

    Because you tell it, in the various configuration files.


    I can heartily recommend WCF the Manual Way…the Right Way for motivation and a complete walkthrough for what you are trying to do – what I have here is just the pertinent points of such an implementation.

    You have three assemblies: Service, Client, ServiceContracts (interfaces only). Service and Client both reference ServiceContracts. Service contains classes implementing the interfaces. Client has proxy classes:

    using System.ServiceModel;
    using ServiceContracts;
    
    public class ExampleServiceProxy : ClientBase<IExampleService>, IExampleService
    {
        public string ExampleMethod()
        {
            return Channel.ExampleMethod();
        }
    }
    

    The client’s config file contains an entry pointing at the service’s svc file; the service’s svc file looks like this:

    <%@ ServiceHost Language="C#" Debug="true" Service="Service.ExampleService" 
        CodeBehind="ExampleService.svc.cs" %>
    

    And the service .svc.cs file looks like:

    using ServiceContracts;
    
    public class ExampleService : IExampleService
    {
        public string ExampleMethod()
        {
            return string.Empty;
        }
    }
    

    That’s it!

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

Sidebar

Related Questions

hey guys, like the title says, how can i accomplish this sort of a
i want to do what the title says like this: int number1; cin>>number1; num1len=log10(number1)+1;
As the title says, I would like to know where or how you can
Like the title says, I want to parse XML in my iPhone application, but
As the title says, I'm trying to do something like this: public abstract class
So as the title says i want to prevent user from keep submiting $_POST
Like the title says, I want to have a HTML table that allows its
Like the title says, I want to know what (int (*)()) in a C-define-function-call
As the question's title says, I want to get the system information (like OS
Like the title says, I am using devise. I want to navigate to /users/1

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.