Webcil reading via SRM or other public library #86587
Replies: 2 comments 6 replies
-
cc @lambdageek |
Beta Was this translation helpful? Give feedback.
-
That's a good question. On the one hand, in some ways Webcil is an internal implementation detail of .NET for WebAssembly. The same way that, for example, NativeAOT's metadata representation or a single-file .NET Core binary's implementation of assemblies is not really a part of its public interface - you can probably poke around in a binary image and find something that represents a Type. Webcil is an artifact of the deployment process - it just happens that at the moment there's a clear 1-1 relationship between individual assemblies and the .wasm modules. The main reason I made a versioned spec for the file format is because we want anti-virus tools to understand the files. On the other hand, I'm sympathetic to the users will want to run other tools to examine the files. I don't think it's reasonable to try and stop them. I'm not sure if we would make the library public in the .NET 8 timeframe - depends on whether we get good feedback in the .NET 8 previews that Webcil is really solving problems for customers. I would love to make WebcilReader part of SRM, but there's an annoying technical complication: SRM is used by Visual Studio and the version of MSBuild that ships with it (that is targeting .NET Framework). So if we make WebcilReader part of SRM, we won't actually get to use it in our build tasks for the .NET for WebAssembly SDK until VS bumps their SRM dependency. If we make a separate Webcil reader nuget I don't see us having the same problems, but we also won't get to use the nice SRM internal classes in the implementation of webcil reader, which is a shame (right now the library does a lot more array allocation and copying than I would have liked) TL;DR I don't want to keep the webcil reader dll private to the .NET SDK, but I also don't have a schedule for how to make it public. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/dotnet/runtime/blob/main/docs/design/mono/webcil.md
I found https://github.com/dotnet/runtime/tree/main/src/libraries/Microsoft.NET.WebAssembly.Webcil/src/Webcil - will that be turned into an official Webcil-reading library for NuGet or merged with System.Reflection.Metadata (SRM) or are there no plans for an official, public library to read Webcil?
Asking for a friend ;-) I work on ILSpy and we use SRM to read bog-standard assemblies.
Beta Was this translation helpful? Give feedback.
All reactions