Question

After upgrading to Visual Studio 2013, I am seeing errors throughout one of my WCF Framework 4.0 projects. Wherever there is a LINQ entity query I am seeing this error upon using any LINQ function such as Any(), Single(), SingleOrDefault(), OrderBy() etc:

 Error  3   The type arguments for method
 'System.Linq.Enumerable.OrderBy<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>,
 System.Func<TSource,TKey>)' cannot be inferred from the usage. Try
 specifying the type arguments explicitly.

Example line of code generating the error:

xxxxXXXXXXStatusList = xxxXXXXXContainer.XXXXXXXStatus.OrderBy(a => a.Status).ToList();

As well as:

 Error  42  Delegate
 'System.Func<BusinessAccess.Entities.XXXPortal.XXXXXXXXInfo, int,
 bool>' does not take 1 arguments

With example:

xxxxxxInfo = xxxXXXXXContainer.XXXXXList.Where(c => c.xxxxxxid.Equals(xxxxxxid)).Single();

Here is what I have tried:

  • Building the project. It builds successfully and hides the errors temporarily until the code is edited.
  • Removing the LINQ reference and re-adding. Unsuccessful.
  • Checking that the target framework was still 4.0. It is.
  • Checked the migration log from 2010 to 2013, which showed a successful migration.
  • Upgrading to VS2013 Update 1: In progress right now...

Any ideas greatly appreciated. Clearly it's a referencing/compile configuration issue, but it's currently eluding me.

Many thanks for your time.

Was it helpful?

Solution

We found it internally. For anyone else seeing blanket problems with Intellisense, yet able to build successfully:

  • Visual Studio 2013 is not compatible with MVC3, which is what was causing all of the errors in our UI projects.
  • Also incompatibilities with Entity Framework 4 were occurring, which is what I was specifically seeing above.

I hope that this helps out someone somewhere.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top