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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:38:51+00:00 2026-06-14T04:38:51+00:00

I have a simple WCF logging service.. namespace WCFServiceLibrary { [ServiceContract] public interface ILog

  • 0

I have a simple WCF logging service..

namespace WCFServiceLibrary
{
    [ServiceContract]
    public interface ILog
    {
        [OperationContract]
        string InsertLogItem(LogItem logItem);
    }

    [DataContract]
    public class LogItem
    {
        private string _Text = string.Empty;

        [DataMember]
        public string Text
        {
            get { return _Text; }
            set { _Text = value; }
        }
    }
}

And I have a client, and a DLL, all in the same solution.

If I reference the service from the Client, I can see the DataContract.
If I reference the service from the DLL, I can NOT see the DataContract.

By which I mean that it I reference the service as LogService, and have this code in the client…

static LogService.LogClient logService = new LogService.LogClient();
//create log item - <<< Compile error in DLL on following line >>>
var itemTolog = new LogService.LogItem { Text = "log this"}; 
string result = logService.InsertLogItem(itemTolog);

then it works fine, but if the same code is in the DLL, then it will not compile due to LogService.LogItem not being visible, and reports the following error

The type or namespace name 'LogItem' does not exist in the namespace 'MyDll.LogService' (are you missing an assembly reference?)    

The dataContract “LogItem” is simply not in the object explorer when the service is referenced from the dll, but it is if referenced from the client exe.

What gives? Needless to say I want to reference the Service from the DLL.
I’ve read elsewhere that you can only see the data contract if it is actively used in one of the service contracts, but it is.

  • 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-14T04:38:52+00:00Added an answer on June 14, 2026 at 4:38 am

    OK. I’ve fixed this by:

    • right clicking on the service reference in the DLL
    • clicked ‘Configure Service Reference…’
    • unchecked “Resuse types in referenced assemblies”.

    tbh I do not know why this works, but it does… [gaelic shrug]

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

Sidebar

Related Questions

I have a simple WCF service with one interface and one class. When I
I have a simple WCF application. In the file IService.cs: namespace WcfService1 { [ServiceContract]
I have a simple WCF service: public Order[] GetOrdersByStatus(int statusid) { OrderService os =
I have a simple WCF service hosted in IIS7 using the HTTP protocol. The
I have a simple WCF Web service. It's hosted on IIS under the default
I have a simple WCF Data Services service and I want to expose a
We have a simple WCF service that is tagged with InstanceContextMode = Single and
I have a very simple WCF service running that has a single method that
I have written a simple WCF service that accepts and stores messages. It works
I have written a very simple WCF service, that worked fine (code below), then

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.