-
Notifications
You must be signed in to change notification settings - Fork 36
Release Builds don't Works #10
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
Comments
I've seen this error a few times, it's almost always due to either build or browser cache. Close visual studio, Manually delete bin and obj folders, and empty all browser caches. If you are running the pwa template with service worker, emptying the cahces might be extra tricky. Let me know if this helps. |
Nahh, I already did that, in the true I even created a new blazor project and copied only the .razor/.cs files, but nothing worked... |
Ok thanks. Could you share your workaround in the meantime? |
Here, it's the BlazorWorker with all changes that I did |
More detailed my changes are in the files: The Eval script in the BlazorWorker.js is the Microsoft.JSInterop Javascript My DOMObject implementation (the main part of the workaround) New Dependencies Required due the workaround This change isn't related with the workaround, I just wanted include custom libraries in my worker thread. |
Thanks, that will give me some ideas for a fix! Regarding the last comment, you can include custom libraries using |
Ohh, good to know, thx, also, I think probabbly this error is something related to the Blazor linker, and probabbly can be solved by excluding that assembly of the linker optimization... |
I can reproduce, thats why I flagged the bug. But it worked when I published the package, a bit weird |
I've had the time to look a tiny bit, I've actually had this error in a previous version of blazor. Back then the solution was similar - the problem seemed to be to directly depend on webassembly.bindings. there is probably a conflict of namespaces, that only manifests when running the linker. A few months ago it manifested all the time. Back then I used some byte trickery so load a different dll than the one requested by the runtime... That could be part of the solution. I'm going to have to compare the memory footprint/load time to see what to do here, (use blazor dlls like you did, or continue to use webassembly.bindings) there is also the issue of the interop classes mostly being non public in the blazor way of interoping... so there is also the issue of maintainability, loading blazor internals with reflection has turned out to be quite fragile in the past. |
Well, as usuall, reflection isn't good |
I could probably fix this by creating a new intermediary assembly. The problem is that blazor, running on the main thread, knows about blazor workercore, where as is doesn't really have to. On the other hand, if it doesn't, the dlls won't be brought when building, so they have to be brought manually somehow. I could do this with custom msbuild steps but I have too little experience with this. But the linker step complicates this. The trick is to find a good compromise I guess, without creating an unmaintainable spaghetti... |
The strategy I'm going to try first when I get my hands on a computer is to remove the dependency to webassebly.bindings, embed the dependency in blazorworker.workercore as a resource, and then load it using reflection. |
When compiling in Release mode with linker activated, the linker gets a bit confused as WebAssembly Runtime exists both in Blazor and WebAssembly.Bindings. Preserving WebAssembly.Bindings from the linker wont help this. it will actually make the problem if not worse, then more explicit. However, removing WebAssembly.Bindings from the eyes of the linker seems to to the trick.. |
This fix will be included in the next release. As 3.2 is out of release candidate while I did this, I probably wont do an explicit release though, it will be the same as the release targeting 3.2 final. |
Okay, thank you, I will take a look soon, because i'm working in another thing now. |
This is in release 1.2.1, package is published. |
Tested, Everything working, thank you :) |
Uh oh!
There was an error while loading. Please reload this page.
My program run fine in debug build, but when I build as Release, I got a Method not found error (

WebAssembly.Runtime:GetDateValue
)First I didn't know from where this happen, but after take a look the
WebAssembly.Runtime
is from theWebAssembly.Bindings
; and this is one of the dependencies of theBlazorWorker.WorkerCore
;And then, i'm here now :)
This probabbly isn't your fault, but I really don't know what I do now...
The text was updated successfully, but these errors were encountered: