Comments (10)
This is a new breaking change in the bootstrapper. For net8 the blazorboot is reconstructed quite heavily with the runtime being split up in two files, dotnet.native.8.0.0.ot6jeefn53.js and dotnet.runtime.8.0.0.1khq4boqw1.js. I'm going to have to do some reading to solve this
from blazorworker.
await dotnet.run()
In any case this line is useless as all it does is call Program.Main() which is needed for nothing.
That is indeed just running main.
@maraf we should update our template to make it clear users don't have to call this.
Something has changed in .net8 which make this line break the runtime.
The change is that we will properly "exit" the "process" after main is finished.
from blazorworker.
Most probably related to this #85
from blazorworker.
.net8 support works in https://github.com/Tewr/BlazorWorker/releases/tag/v4.0.0-preview2 , try it out.
from blazorworker.
Yes most likely. The breaking changes of net7 are not likely to have been reverted in net 8
from blazorworker.
I've made some progress here tonight, but Crucial JsInterop fails without error
#91
from blazorworker.
Some notes on progress.
Some further investigation show that while JsInterop seems to work OK, Tasks does not seem to work correctly. I can finalize the service Init message loop without errors, as the service init function is fully synchronous. That is, I send a message to initialize a service in the worker, and the service starts, and sends a "initialized" message back to the UI thread without problems.
So the dotnet environments starts, and functions can be executed as long as they are synchronous or does not provoke an actual Task switch. If a task is force started with Task.Run
, it never executed. if I attempt to await Task.Delay
, the calling function seems to freeze over. The details need to be investigated further, but at a first glance the first Task
which is not the main Task and thus run on the Task scheduler is stuck in WaitingForActivation
status.
It is possible that there are some new defaults for the Task scheduler when starting the runtime? That makes it default to a single task when running on a worker. Some kind of different behaviour when detecting that being run in a worker. Maybe some side effect from the work that has already started on multithreading in the runtime.
from blazorworker.
I would really like this to be fixed.
Would it be possible to push a build that only supports syncronous workloads?
from blazorworker.
I haven't been able to reproduce a fully working runtime even while avoiding the triggering of a task switch. Something is missing.
The following linked issue plans to post/blog some kind of guide, might be useful but seems like they are planning for a demo using a separate template and a separate build, which is a bit sad, cause it's a lot more work
from blazorworker.
Some good news after climbing down the rabbit hole: need more investigation but await dotnet.run();
, which was introduced by me while testing .net7, seems to be the culprit.
Seems to work fine after removing this line. Something has changed in .net8 which make this line break the runtime. In any case this line is useless as all it does is call Program.Main() which is needed for nothing.
If this is really the case, I might be able to get out a beta version in a few days. I need to get some kind of basic multitargeting code in place first
from blazorworker.
Related Issues (20)
- Exception: Unable to find compatible constructor for activating type 'My.WorkerStartup'. HOT 1
- Serialization error with IoC and starting a worker HOT 5
- Managing App State with Service Workers in Blazor WASM HOT 2
- Errors when using library HOT 1
- CreateBackgroundServiceAsync results in exception saying System.Private.DataContractSerialization.resources can't be found... HOT 2
- .Net 6 HOT 6
- Only globalization-invariant mode is supported in the WorkerService HOT 5
- BlazorWorker does not work in net6 with published release HOT 11
- Odd exception thrown in WASM-WORKER when instantiating worker service: Missing Assembly System.Net.Http HOT 4
- SerializeLinqExpressionSerializer.cs - no matching element HOT 8
- Sample request - BlazorWorker interacting with in-page JavaScript HOT 1
- Webworker with stimulsoft HOT 2
- Any nuget-released planned including environment variable for culture? HOT 1
- Worker filesystem access HOT 1
- System.ArgumentException: The object must be a runtime Reflection object. -On Simple Service creation HOT 1
- Non-RPC Access HOT 1
- Cannot be initialized when not on `/` HOT 6
- .NET 7 Support? HOT 27
- nuget.org releases missing? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazorworker.