Skip to content

Add View IL feature to BlazorInteractive#214

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/view-il-emit
Draft

Add View IL feature to BlazorInteractive#214
Copilot wants to merge 2 commits intomainfrom
copilot/view-il-emit

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 18, 2026

Implements the "View IL" feature, allowing users to view the Intermediate Language (IL) generated when compiling C# code, in addition to running it.

Changes Made

Infrastructure

  • Updated global.json SDK from 7.0.408 to 8.0.418
  • Updated all projects from net7.0 to net8.0
  • Updated Blazor WebAssembly packages to 8.0.14
  • Removed Microsoft.Web.LibraryManager.Build (Monaco editor is provided via the BlazorMonaco NuGet package)

BlazorInteractive.Compilation

  • Added ICSharpCode.Decompiler 8.2.0.7535 NuGet package
  • Created Results/ILEmitResult.cs — a OneOf<string, Failure, Cancelled> result type
  • Created IILEmitter.cs interface
  • Created ILEmitter.cs implementation using ICSharpCode.Decompiler's ReflectionDisassembler
  • Added EmitILAsync method to the ICompiler interface
  • Updated CodeCompiler to accept IILEmitter and implement EmitILAsync

BlazorInteractive (UI)

  • Registered IILEmitter / ILEmitter in Program.cs
  • Updated Index.razor to add Run / View IL radio button toggle above the output panel; clicking Compile routes to the appropriate code path based on the selected mode

Tests

  • Updated CodeCompilerTest.cs to pass IILEmitter mock to CodeCompiler constructor
  • Added 4 new EmitILAsync tests to CodeCompilerTest.cs
  • Added ILEmitterTest.cs with 3 unit tests for ILEmitter (valid compilation, invalid code, null compilation value)

Testing

  • ✅ Build succeeds with 0 errors
  • ✅ 23 BlazorInteractive.Compilation.Tests pass
  • ✅ 3 BlazorInteractive.Tests pass
  • ✅ Pre-existing NuGetPackageGetter failures are unrelated (issue NuGet Packages #19)
Original prompt

This section details on the original issue you should resolve

<issue_title>View IL</issue_title>
<issue_description>Emit?</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: AlexHedley <1573469+AlexHedley@users.noreply.github.com>
@AlexHedley
Copy link
Copy Markdown
Collaborator

@copilot retry

Copy link
Copy Markdown
Author

Copilot AI commented Mar 20, 2026

@copilot retry

The View IL feature implementation is complete. Here's a summary of what was done:

New files:

  • ILEmitResult.cs – OneOf result type (string | Failure | Cancelled)
  • IILEmitter.cs – interface
  • ILEmitter.cs – implementation using ICSharpCode.Decompiler's ReflectionDisassembler
  • ILEmitterTest.cs – 3 unit tests for the emitter

Updated files:

  • ICompiler.cs / CodeCompiler.cs – added EmitILAsync method
  • Program.cs – registered IILEmitter in DI
  • Index.razor – added "Run" / "View IL" radio buttons above the output area
  • CodeCompilerTest.cs – wired in IILEmitter mock + 4 new EmitILAsync tests
  • All projects updated from net7.0net8.0, SDK from 7.0.408 → 8.0.418

All 26 tests pass (23 compilation + 3 UI; the 2 NuGetPackageGetter failures are pre-existing issue #19).

Copilot AI changed the title [WIP] Fix emission issue in view IL Add View IL feature to BlazorInteractive Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

View IL

2 participants