Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2015 does not see Linq in RazorEngine template

I'm trying to create the simplest possible RazorEngine startup project with full IntelliSense in Visual Studio 2015.

I'm strugguling on making Linq extensions available in the templates. They are correctly compile, but Visual Studio still ouput an error when the template is open:

'List < string > ' does not contain a definition for 'Select' accepting a first argument of type 'List < string > ' could be found (are you missing a using directive or an assembly reference?)

And the error on @using System.Linq, but the error is:

The type or namespace 'Linq' does not exist in the namespace 'System'

What am I missing?

The full code is on this branch : https://github.com/cyrilgandon/RazorEngineGenerator/tree/LinqUnavailable

I can see that some posts advise to add references in the app.config, but I don't see anywhere in the docs (link) the need to do that.

like image 610
Cyril Gandon Avatar asked Nov 21 '22 13:11

Cyril Gandon


1 Answers

I had same issue, and I have tried everything I could find here and nothing worked. So finally I have changed .NET framework version from 4.0 to 4.5.2 and problem was gone.

like image 185
Marko Frntić Avatar answered Mar 24 '23 19:03

Marko Frntić