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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:33:42+00:00 2026-06-09T23:33:42+00:00

I have a project with two dll’s (I’ll name them A & B). In

  • 0

I have a project with two dll’s (I’ll name them A & B).
In the first dll I want to pass a object of a web reference to my other dll.
The two dll’s use properties from the object so I have added a web reference to the service in both my dll’s.

But when I want to pass this object I get an error:

The best overloaded method match for 'method in dll B (B.com.test.services.Task)' has some invalid arguments.

So my dll A expects it to be a object of type A.com.test.services.Task while it gets an object of type B.com.test.services.Task.

How do I fix this?

Some code:

Dll A:

using A.com.test.services
public string BuildDetail(Task task, bool TaskExecutionState, bool TaskComment) 
{
    DetailScreen detail = new DetailScreen(task);   //error is here.
    return detail.Layout;
}

Dll B:

using B.com.test.services 
public DetailScreen(Task task)
{
    //some code
}
  • 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-09T23:33:44+00:00Added an answer on June 9, 2026 at 11:33 pm

    The problem is that creating a web reference means that proxy classes are created for each types of the referenced service.

    Suppose you have your dll, A.dll and you create a web reference to a service with the type Task. Inside A, a proxy type, let’s call it A.Task will be created. The type Task and A.Task are two different types, Task exists on the server, A.Task exists on the client

    Then, you have another DLL, B.dll and once again you add a web reference. This time, yet another proxy type will be created, let’s call it B.Task. And although A.Task and B.Task probably look alike, they are two different types (most probably they exist in two different namespaces).

    There are two possible approaches. First – create your own mapping classes with methods which take A.Task and make B.Task out of it (and the other way around possibly).

    But the other approach involves creating a “common language” – a shared DLL (let’s call it Task.dll) where you put your Task class. You reference the DLL everywhere, in your webservice, in A.dll and in B.dll. Everytime you create a web reference, you make sure that the option “Reuse types from referenced assemblies” is checked (at reference properties page).

    This way, there will be no proxy types created for the type Task – the same class will be used at the server side and at the client side. There will be then no need to convert anything and you will be able to pass references around.

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

Sidebar

Related Questions

There're two dlls I want to reference in my project. They are A.dll and
I have two vc++ dll projects, which will generate two dlls. A vector<vector<string>> object
Need to add two same name .csproj class libraries in my solution.Have two project
Hello I have two project in a .NET 4.0 framework visual studio solution. First
I have two different version dll of ajaxcontroltoolkit in a project, i can not
I have a vb.net 3.5 class library project that needs to reference two assemblies
I have two projects in my solution. The first project is a WPF application,
First, I have two project working on: ASP.NET and Silverlight Both uses a class
I have a base project that feeds two different projects. I want to be
I have two projects. First one is Wpf Project (FrameWork 3.5) with next interface:

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.