Search Results for "James Marzik"

Compiling and Running a DLL in .NET Core 2 Using Roslyn and Reflection

During a recent client engagement, my team and I were given an unusual task: give the user the ability to write, compile, and run Visual Basic .NET code in a web app environment. This presented us with a great learning opportunity since no one on the team had experienced anything like this before. Our first choice was to use the System.CodeDom namespace to compile the source code and generate a dll to be run on-demand in other components of our web app. However, we quickly discovered that while CodeDom is available for .NET Core 2 (after installing it via NuGet), calls to the CompileAssembly methods would throw a System.PlatformNotSupportedException. We knew that we would need to change our approach. This led us on a path to Roslyn. Roslyn is a .NET compiler framework written in .NET. It contains code analysis…