New extension method EnumerableExtensions.Any() has the same signature as standard extension method System.Linq.Enumerable.Any(). It leads to the build error like this:
The call is ambiguous between the following methods or properties: 'NuGet.EnumerableExtensions.Any<string>(System.Collections.Generic.IEnumerable<string>)' and 'System.Linq.Enumerable.Any<string>(System.Collections.Generic.IEnumerable<string>)'
Steps to reproduce:
1. Add reference to NuGet.Core in your project
2. Try to compile this:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
using NuGet;
namespace TestProject1
{
[TestClass()]
public class Class1Test
{
[TestMethod()]
public void TestTest()
{
var items = new[] { "foo", "bar" };
var result = items.Any();
Assert.IsTrue(result);
}
}
}
The call is ambiguous between the following methods or properties: 'NuGet.EnumerableExtensions.Any<string>(System.Collections.Generic.IEnumerable<string>)' and 'System.Linq.Enumerable.Any<string>(System.Collections.Generic.IEnumerable<string>)'
Steps to reproduce:
1. Add reference to NuGet.Core in your project
2. Try to compile this:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
using NuGet;
namespace TestProject1
{
[TestClass()]
public class Class1Test
{
[TestMethod()]
public void TestTest()
{
var items = new[] { "foo", "bar" };
var result = items.Any();
Assert.IsTrue(result);
}
}
}