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

  • Home
  • SEARCH
  • 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 3360022
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:56:35+00:00 2026-05-18T02:56:35+00:00

I am having multiple Services in my application.i have a datacontract that i need

  • 0

I am having multiple Services in my application.i have a datacontract that i need to use in more than 1 service.

Eg: class myCommonClass is being used in 2 of my services service1 and service2

To do this, at a service level, i have a MyApplication.Common library and this library contains myCommonClass. Since both my services have a reference to MyApplication.Common, they can both use it.

My client application has service references to both service1 and service2.
To my client application, service1.myCommonClass is a separate namespace as compared to service2.myCommonClass and therein lies my problem

In my Reference.cs (generated via svcutil – the namespace of BOTH classes is the same i.e.

System.Runtime.Serialization.DataContractAttribute
(Name="MyCommonClass", Namespace="http://A.B.MyCommonClassNamespace")])

However, both of these are in 2 separate reference.cs files and the namespaces in the reference.cs is different due to being part of two separate service references.

Hence, to my client application they appear as two completely unrelated classes.

*Question 1 * : Is there any way that can i indicate to my client application that service1.myCommonClass and service2.myCommonClass are inherently the same class?

*Question 2 * : Is there something inherently wrong with my design here for me to run
into this problem?

  • 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-18T02:56:36+00:00Added an answer on May 18, 2026 at 2:56 am

    No, your design is fine. Instead of adding service reference from Visual Studio, generate the proxy class using svcutil on the command prompt. Create a class library project and add the generated .cs files to it. You can create a batch file and run it in pre build step as well.
    Use svcutil as below to generate the proxy class in a single file from service dll (the dll that implements your two service)

    svcutil.exe /t:metadata "PATH\service1.dll" "PATH\service2.dll"  
    svcutil.exe /t:code *.wsdl *.xsd /o:Proxy.cs
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple layers in an application and i find myself having to bubble
I have an application that I would like to have support SQL Server Mirroring.
I'm working on a web application that renders a reporting services report as a
I have written an ASP.NET MVC application that allows the user to specify their
I have an environment where multiple sites hosted on the same server will use
I do not want to alienate my users, but having multiple ways to sign
I am having problems with text with multiple lines not reformatting properly when I
Having read the threads Is SqlCommand.Dispose enough? and Closing and Disposing a WCF Service
I have a static object defined in my logging class, along the lines of:
I have an asp.net mvc application with three layers: - data layer with entities

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.