StackExchange / StackExchange.Precompilation

Roslyn based csc.exe and aspnet_compiler.exe replacement with metaprogramming hooks for ASP.NET MVC projects from the pre-DNX era
MIT License
155 stars 37 forks source link

Unable to use C#7.0 features in .cs files #30

Closed antur84 closed 7 years ago

antur84 commented 7 years ago

Hi

I'm trying to use any C#7.0 feature, like inline out params and digit_separator, in any *Controller.cs, but it won't compile as soon as I install Precompilation 3.3.0 package.

I don't get any error in the Error List, but you can see them in the output build log, that the precompilation compiler does not recognise the new features. If I force the /langlevel:7 flag it will complain that it has to be between 1-6

My easiest way of reproducing is starting a new project in VS (2017 community), MVC, based on net4.6.2.

Any ideas?

m0sa commented 7 years ago

SE Precompilation 3.* is built agains older roslyn packages that don't support c# 7 yet. Try the SE Precompilation pre-release packages (4.0) from the appveyor nuget feed described in the readme.

We're already running it in production on StackOverflow, I just didn't find time yet to do a release to nuget.org.