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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:21:59+00:00 2026-06-04T20:21:59+00:00

I Am working on an assignment and I get this error: Error 1 Inconsistent

  • 0

I Am working on an assignment and I get this error:

Error 1 Inconsistent accessibility: parameter type ‘MexWcfService.MyComplex’ is less accessible than method ‘MexWcfService.Calculator.complex_sum(MexWcfService.MyComplex, MexWcfService.MyComplex)’ E:\North Central College\CSC615\lab8\MexWcfService\MexWcfService\Program.cs 75 26 MexWcfService

Below is my code. My issue occurs inside the interface implementation class at ..public MyComplex complex_sum(MyComplex a, MyComplex b)…

Can some one help me out here. I am pretty new to C# let alone WCF with Metadata Exchange Endpoints. Any pointers would be greatly appreciated.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;
using System.ServiceModel.Description;

namespace MexWcfService
{
    [DataContract]
    class MyComplex
    {
        int real;
        int im;
        public MyComplex(int real, int im)
        {
            Real = real;
            Im = im;
        }

        [DataMember]
        public int Real
        {
            get { return real; }
            set { real = value; }
        }
        [DataMember]
        public int Im
        {
            get { return im; }
            set { im = value; }
        }

    }
    [ServiceContract]
    interface ICalculator
    {
        [OperationContract]
        int mult(int a, int b);

        [OperationContract]
        List<int> fib(int n);

        [OperationContract]
        MyComplex complex_sum(MyComplex a, MyComplex b);
    }

    public class Calculator : ICalculator
    {

        public int mult(int a, int b)
        {
            int total = (a * b);
            return total;
        }
        public List<int> fib(int n)
        {
            List<int> list = new List<int>();
            for (int i = 0; i < n; i++)
            {
                int a = 0;
                int b = 1;
                for (int q = 0; q < i; q++)
                {
                    int temp = a;
                    a = b;
                    b = temp + b;
                }
                list.Add(a);
            }

            return list;
        }
        public MyComplex complex_sum(MyComplex a, MyComplex b)
        {
            int real = (a.Real + b.Real);
            int im = (a.Im + b.Im);

            MyComplex complex = new MyComplex(real, im);
            return complex;
        }

    }

    class Program
    {
        static void Main(string[] args)
        {
            ServiceHost host = new ServiceHost(typeof(Calculator), new Uri("http://localhost:50000/Math"));
            host.AddServiceEndpoint(typeof(Calculator), new BasicHttpBinding(), "mult");
            ServiceMetadataBehavior bhv = new ServiceMetadataBehavior();
            bhv.HttpGetEnabled = true;
            host.Description.Behaviors.Add(bhv);
            host.Open();
            Console.ReadLine();


        }
    }
}
  • 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-04T20:22:01+00:00Added an answer on June 4, 2026 at 8:22 pm

    You need to declare the class ‘MyComplex’ as public, as you have used the type in a public method in the class Calculator.

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

Sidebar

Related Questions

I am working on an assignment and I am getting this error which I
I've been working on this assignment, where I need to read in records and
I'm currently working on an assignment and this have had me stuck for hours.
Working on a class assignment and when I run this code function paycheck1($hours,$payrate,$othours,$otrate){ if
For a homework assignment, we are working on CSV parser. I'm trying to get
I'm working on something in c# and I get an error when I try
I've been butting my head against this problem in an assignment I've been working
i`m working on my assignment for univ, and since some parts are not really
I'm working on an assignment to implement insertions into an AVL tree, and I'm
I am working on an assignment for networking where we are supposed to create

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.