Skip to content

A Visual Studio extension 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.

License

Notifications You must be signed in to change notification settings

jeffmccormick/ILSupport

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IL Support extension

IL Support is an extension for Visual Studio 2012, 2013, 2015 and 2017 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.

Syntax Highlighting

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.

Project Templates

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 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

Modifying your own projects to allow IL embedding

#.NET Framework

  1. 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>
-->
  1. 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

How does it work ?

The project modification adds 5 simple steps :

  1. Hide IL files from the compiler
  2. Let the project compile
  3. Decompile the resulting assembly into IL
  4. Comment out all methods that were marked with the forwardref method implementation option
  5. Recompile the commented out IL with all the other IL files

License

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.

About

A Visual Studio extension 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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 72.3%
  • Visual Basic .NET 26.0%
  • F# 1.7%