RazorEngine templates in VS 2015 - Feature 'implicitly typed local variable' is not available in c# 2
Asked Answered
N

1

14

I get the below error when I open RazorEngine cshtml template file in my VS 2015 project.

Feature 'implicitly typed local variable' is not available in c# 2. Please use language version 3 or greater.

The template compiles correctly, just the intellisense is broken.

The project is set up to use .net 4.5 while building. The app is also not an ASP.Net, but a desktop one.

The intellisense also worked fine in VS 2013. The issue appeared after the upgrade to VS 2015.

Does anyone had similar issue and could advice how to resolve this?

Nonalcoholic answered 20/3, 2017 at 10:4 Comment(0)
T
8

I was able to fix the intellisense by adding these lines to the app.config file. Restart Visual Studio after making the change.

<system.web>
    <compilation debug="false" targetFramework="4.5.1" />
</system.web>
Tristan answered 20/7, 2018 at 15:39 Comment(1)
After the above changes I only had to rebuild the solution to fix the problems.Helprin

© 2022 - 2024 — McMap. All rights reserved.