Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Tor Langlo 130 posts 327 karma points
    Nov 21, 2017 @ 17:24
    Tor Langlo

    Is it possible to configure an Umbraco 7 site to compile the templates/views using c# 6? If yes, how?

    What if the site is hosted on the Umbraco Cloud?

  • Dan Diplo 1457 posts 5618 karma points MVP 3x c-trib
    Nov 22, 2017 @ 14:39
    Dan Diplo

    Not sure on Cloud, but locally you can:

    Updated the Microsoft.Net.Compilers NuGet package to latest version.

    In your web.config add:

          <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:7 /nowarn:1659;1699;1701" />

    Change langversion to suit.

  • Tor Langlo 130 posts 327 karma points
    Nov 22, 2017 @ 18:39
    Tor Langlo

    Thanks, Dan! I was aware of this, but uncertain if it will work on Umbraco Cloud. Anyone tried it?

  • Giacomo De Liberali 8 posts 78 karma points
    Feb 10, 2019 @ 13:24
    Giacomo De Liberali

    Does it work in Cloud in the end or not?

  • Tor Langlo 130 posts 327 karma points
    Feb 10, 2019 @ 15:05
    Tor Langlo

    This comes built in with the latest Umbraco version, so if you’re keeping up with the upgrades in Umbraco Cloud, then yes, it works!


Please Sign in or register to post replies

Write your reply to: