-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blazor DLL -> WASM file extension change causing functionality failure when updating to .Net 8 #103071
Comments
Just disable the <PropertyGroup>
<WasmEnableWebcil>false</WasmEnableWebcil>
</PropertyGroup> More info: Webcil Documentation In short, the payload is different, and .NET cannot load this directly. The webcil to PE conversion is not supported, and this is intentional. |
So I won't be able to cater to those people who have that firewall issue that's mentioned in that doc. I get that it's the same for .Net 6, which doesn't have |
Disabling WebCIL did work, BTW. |
I had this same problem for my project as well (WasmSharp), I've not been contributing to it for a while, but I do have a couple of things bookmarked to look at regarding WebCIL, the idea being that maybe (eventually) I could accept the WebCIL format and decode it myself. Firstly, there is this PR which adds support to ILSpy for decoding WebCIL: icsharpcode/ILSpy#3184 And more importantly, I found this: https://github.com/StefH/ProtoBufJsonConverter/tree/main/src-webcil
I haven't had the time to investigate any further myself, but I'll leave these links here in case they are useful |
Tagging subscribers to this area: @dotnet/area-system-reflection-metadata |
Your scenario involves passing to Roslyn assemblies that are already loaded in your app. One way to implement this is:
There isn't something required here on SRM's side. Reading metadata from WebCIL files without loading them should be tracked by a separate issue, if someone requests it. |
Is there an existing issue for this?
Describe the bug
Similar to dotnet/aspnetcore#52162, I need to load assemblies after the website as loaded. However, I'm loading them into a compilation context so that users can enters some C# code which I then compile. (See https://json-everything.net/json-schema (source), and select "Generate a Schema".)
The problem on that site (because I haven't updated it yet) is that it can't find the
.dll
s... because they've been renamed to.wasm
s. I'm okay with the rename.My problem, however, is that these
.wasm
files aren't accepted by the .Net emitter.This code works in .Net 6, using
.dll
files:Loading the references
Compiling
The diagnostics in the
emitResult
are primarily to do with the references:This happens whether the code should compile or not.
Expected Behavior
I expect the files to load into the compilation context and the emit to work, just as it does with .Net 6.
Steps To Reproduce
Minimal repro: https://github.com/gregsdennis/aspnet56080-repro
The solution file is in
/BlazorApp1
for some reason. Not sure how that happened.The .Net 6 app works fine, but the .Net 8 app doesn't. The only thing the .Net 8 app does differently is load
.wasm
s instead of.dll
s.Exceptions (if any)
There are no exceptions, just the emit diagnostics.
.NET Version
8.0.206
Anything else?
Happy to know if there's something I'm missing, but it's obvious to me that the contents of a
.wasm
are different from the contents of a.dll
. The assembly loader may be set up to understand and account for the difference, but the compiler/emitter isn't.workaround
disable the .wasm extension for your project:
The text was updated successfully, but these errors were encountered: