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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:41:37+00:00 2026-05-23T23:41:37+00:00

I am experiencing a strange compiler error with extension methods. I have an assembly

  • 0

I am experiencing a strange compiler error with extension methods. I have an assembly which has an extension method like

public static class MyClass
{
    public static Bar GetBar(this Foo foo)
    {
        return new Bar();
    }
}

And elsewhere in the same assembly i do something like this

Foo foo = new Foo();
var bar = foo.GetBar();

When i clean and compile everything is OK. BUT once i make a small change (like an extra whitespace) in the assembly and build again I get an error like this:

Error 973 The call is ambiguous between the following methods or properties: ‘MyNameSpace.MyClass.GetBar(Foo)’ and ‘MyNameSpace.MyClass.GetBar(Foo)’

Only after i clean the project I can build again. Is this a problem in the compiler using an old version of the assembly? Only work around I see now is to replace my extension methods with normal static methods.

  • 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-23T23:41:38+00:00Added an answer on May 23, 2026 at 11:41 pm

    Ok having done a bit of playing round I can reproduce a similar situation to this by adding a file reference to the output file – the first time round it builds successflly (as the reference is not used – you simply get a “reference not resolved” warning), however from this point on I see the “The call is ambiguous” error appear in the code editor.

    For me however this doesn’t prevent me from building the solution (I’m testing this using Visual Studio 2010), however the error does appear – maybe under slighly different circumstances, such as a different Visual Studio version, this would stop the project from compiling.

    You could also engineer this same situation with post-build steps that copy the output assembly.

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

Sidebar

Related Questions

I'm experiencing some strange behavior for which I can't find any documented knowledge. Here's
I'm experiencing something really strange! I have a div that I'm hiding with JS
I'm experiencing a strange behaviour when looking via reflection for annotations on a method
I am experiencing a strange problem with an Oracle DB, and would like to
I am experiencing some strange behaviour and I really don't have test date/ environments,
I am experiencing some strange behavior with SQL Server CE 3.5 SP2. I have
I have upgraded to Delphi XE from 2009 and am experiencing a strange issue.
I have been experiencing strange behavior with the header drawing the first time. Here
I experiencing a strange behavior of C#. Its some thing like this.. var date
I'm experiencing a strange exception from my application. It has been working well until

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.