Wolfram Library Archive

All Collections Articles Books Conference Proceedings
Courseware Demos MathSource Technical Notes
Title Downloads

Mixed Language Compilation of C# Code

Frank Kampas
Organization: Physicist at Large Consulting
Revision date


In-memory compilation of C# can be accomplished through .NETLink using the compiler built into the .NET runtime. This is more convenient for developing and testing C# code than using Microsoft Visual Studio and then calling the resulting assembly from .NETLink. In that situation it is necessary to release the assembly from .NETLink before it can be recompiled in Visual Studio. This is not necessary for the technique discussed here. If there are compilation errors, the code described here reproduces the code lines containing errors with the error position marked. Also, compiling C# code in memory can provide faster numerical calculations than can be obtained using the internal compiler.

*Applied Mathematics > Numerical Methods
*Wolfram Technology > Linking Technology > .NET/Link

C#, Mixed Language, Numerical Calculations
Downloads Download Wolfram CDF Player

mixed_lang_c#.nb (45 KB) - Mathematica Notebook