IL Support is an extension for Visual Studio 2017 and 2019 that provides syntax highlighting for the IL (Intermediate Language) and project templates for C#, F# and Visual Basic that support embedding and calling IL code. You can download it through the Extension Manager, or on the Visual Studio Marketplace.
IL Support includes a simple syntax highlighter for IL files (.il). It adds 3 configurable custom classifications (Instruction, Directive and Directive (Security)), in addition to using the standard classifications.
IL Support includes multiple project templates that support embedding and calling IL code in addition to another language (C#, F# and Visual Basic). The generated projects have no dependencies and should build on any Visual Studio 2010/2012/2013/2015/2017/2019 installation, even without this extension installed. They support all the project properties and configurations, build incrementally, and allow breakpoints and debugging step by step in both the main language and the IL.
Every non-empty project contains a simple example showing how to embed IL.
The following projects are included:
- Visual C#
- Empty Project with IL Support
- Class Library with IL Support
- Portable Class Library with IL Support
- Console Application with IL Support
- Windows Forms Application with IL Support
- WPF Application with IL Support
- Visual F#
- F# Application with IL Support
- F# Library with IL Support
- F# Portable Library with IL Support
- Visual Basic
- Empty Project with IL Support
- Class Library with IL Support
- Portable Class Library with IL Support
- Console Application with IL Support
- Windows Forms Application with IL Support
- WPF Application with IL Support
#.NET Framework
- Edit your project file and insert this before the following section (which should be at the end)
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
- You're done! Create a new project with IL Support if you need an example of how to embed IL.
#.NET Standard/Core
With the new Visual Studio .csproj
format, the targets are slightly different. Complete the steps for .NET Framework, except use this anywhere in your project file
The project modification adds 5 simple steps :
- Hide IL files from the compiler
- Let the project compile
- Decompile the resulting assembly into IL
- Comment out all methods that were marked with the forwardref method implementation option
- Recompile the commented out IL with all the other IL files
IL Support is licensed under the MIT License. This means you can do whatever you want as long as you include the original copyright.
See the LICENSE.md file for the full license text.