Microsoft Roslyn vs. CodeDom

Disclaimer: I work for Microsoft on the Roslyn team. CodeDom is a precursor to Roslyn, but is only marginally related. Essentially, CodeDom is a simple and (somewhat) langage agnostic way to generate code that was added in .NET 1.0 to support designers (a la WinForms). Because CodeDom was an attempt at providing a unified model … Read more

Is nameof() evaluated at compile-time?

Yes. nameof() is evaluated at compile-time. Looking at the latest version of the specs: The nameof expression is a constant. In all cases, nameof(…) is evaluated at compile-time to produce a string. Its argument is not evaluated at runtime, and is considered unreachable code (however it does not emit an “unreachable code” warning). From nameof … Read more

C# 6.0 Features Not Working with Visual Studio 2015

This works in MVC 5 (tested 5.2.3), you just need to add the roslyn code dom Nuget package CodeDOM Providers for .NET Compiler… Replacement CodeDOM providers that use the new .NET Compiler Platform (“Roslyn”) compiler as a service APIs. This provides support for new language features in systems using CodeDOM (e.g. ASP.NET runtime compilation) as … Read more

Could not find a part of the path … bin\roslyn\csc.exe

TL; DR run this in the Package Manager Console: Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r More information This problem is not related to Visual Studio itself, so answers suggesting adding build steps to copy files over are rather a workaround. Same with adding compiler binaries manually to the project. The Roslyn compiler comes from a NuGet package and … Read more