The type arguments for method cannot be inferred from the usageAugust 19th, 2013
Visual Studio can have problems understanding LINQ expressions in Razor views, complaining with the recurring error message when hovering the inline expression:
“The type arguments for method … cannot be inferred from the usage. Try specifying the type arguments explicitly.”
Even though the code is correct and everything works as expected, the MVC view gets cludded with warnings and Intellisense doesn’t work inside the LINQ expressions.
targetFramework="4.0" in the compilation node in web.config, and then re-compile:
<compilation defaultLanguage="c#" targetFramework="4.0">