C# woes - "call is ambiguous between the following methods" - identical methods

Oh the irony. An ambiguous message about ambiguous methods. As you'll notice, the conflicting method names are the exact same:

Error 48 The call is ambiguous between the following methods or properties: 'Ecommerce.Core.Helpers.DateTimeHelpers.Verify(System.DateTime?)' and 'Ecommerce.Core.Helpers.DateTimeHelpers.Verify(System.DateTime?)' C:\Ecommerce\Ecommerce.Core\Helpers\DateTimeHelpers.cs 9 24 Ecommerce.Core

The issue here was that my Ecommerce.Core project was referencing itself. Yes, you heard that right. At first I assumed I was responsible but upon closer inspection it looks like Visual Studio or a Visual Studio plugin was responsible for automatically adding the reference...

I removed the reference and, voila, the error (actually hundreds of errors for various methods) disappeared. I don't mean this in a cynical way, but I would legitimately like to know if there are any valid use cases for a project referencing itself.

Comments

Popular posts from this blog

Excel - Adding an existing Pivot table to the data model

Getting Started with Mirth (Part 1)

Mirth