Translate C# code to JavaScript in Visual Studio using DuoCode

Sunday, March 29, 2015 1 Comments A+ a-

I have just seen this interesting thing that is launched with Roslyn Compiler in C# 6 which is that we can now write code in C# and Roslyn Compiler will translate it in to JavaScript for us.It is a tool for compiling JavaScript without actually writing JavaScript.

It allows developers to develop Html5 applications using C# and .Net Framework inside the Visual Studio IDE.

It also supports many C# features including Class Inheritance,strong typed classess,generics, Linq, Lambda Expressions, Reflection

The name of this is DuoCode. It is also called Cross Compiler as it cross compiles C# code in to JavaScript.

DuoCode is a fully-featured C# compiler, powered by Microsoft® Roslyn, and integrated in Visual Studio.

It cross-compiles your C# 6.0 code into high-quality readable JavaScript code, enabling rapid development of web applications utilizing the extensive features of the C# language, the Visual Studio IDE, and the .NET Framework base class libraries.

It automatically generates source mappings which allows developers to see and debug C# code inside the browser in Visual Studio 2015.

This feature allows developers do full debugging of C# code using browser Developer tools which includes breakpoints, step in, step over , watch etc.

You can see live working sample here and here is the official site of DuoCode

It is available as Visual Studio Extension in Visual Studio Gallery with title DuoCode for Visual Studio and is also available as Nuget Package. It is automatically added to the project when creating project from the template.

For adding in existing project run Install-Package DuoCode -pre from Nuget Package Manager Console.
Coursera - Hundreds of Specializations and courses in business, computer science, data science, and more


Write comments
October 1, 2015 at 3:40 AM delete

Wow, brilliant article that I was searching for. Helps me a lot in taking class for my students, so using it in my work. Thanks a ton. Keep writing, would love to follow your posts.
Dot Net training institute in Chennai | Dot Net training institute in Chennai | Dot Net training institute in Chennai