dotnet-state-machine / stateless

A simple library for creating state machines in C# code
Other
5.6k stars 766 forks source link

Blazor Web Assembly .Net6 #465

Closed famda closed 1 year ago

famda commented 3 years ago

Hi,

I'm trying to use the library on .net 6 on blazor web assembly project without success.

The project compiles without issues but can't load the page and presents this error:

image

Is there any issues with it?

danielmertens commented 2 years ago

+1

I'm having the same issue. I tried to load the assembly manually but this didn't work

HttpClient client = new HttpClient();
var netstandard = await client.GetByteArrayAsync("https://localhost:7028/_framework/netstandard.dll");
var stateless = await client.GetByteArrayAsync("https://localhost:7028/_framework/stateless.dll");
AppDomain.CurrentDomain.Load(netstandard);
var assembly = AppDomain.CurrentDomain.Load(stateless);

I think the solutions is to upgrade the project to .Net 6.0

Blackclaws commented 2 years ago

Rebuild the library yourself and the result should work. I've had similar issues with loading it in Unity. Possible Reason: https://github.com/dotnet-state-machine/stateless/issues/449

mclift commented 1 year ago

Having tested this in a simple Blazor app, it looks like this was fixed by #480. @famda @danielmertens, please let us know if you're still seeing this issue!