Skip to content
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

Usage of SyncWork most of time show this exception System.TypeLoadException: Unable to load Orleans.SyncWork.ISyncWorker`2,Orleans.SyncWork from assembly Orleans.SyncWork #60

Open
realkarimfahmy opened this issue Oct 18, 2024 · 3 comments

Comments

@realkarimfahmy
Copy link

Usage of SyncWork most of the time show this exception

System.TypeLoadException: Unable to load Orleans.SyncWork.ISyncWorker`2,Orleans.SyncWork from assembly Orleans.SyncWork.

I have followed your repo example

Steps to reproduce the behavior:

  1. I downloaded this package to 3 projects (API, Grains, Silo)
  • API code:
    var jobGrain = _clusterClient.GetGrain<IPasswordVerifierGrain>(Guid.NewGuid());
    var result = await jobGrain.StartWorkAndPollUntilResult(request);

2- Grains project has the same implementation as the repo example

  1. Silo project has this usage:
    .ConfigureSyncWorkAbstraction(Environment.ProcessorCount - 2) // Add this line to configure Orleans.SyncWork

See Result
image

image

@Kritner
Copy link
Member

Kritner commented Oct 18, 2024

What is the difference between the two screenshots posted? it's just randomly failing sometimes, and other times not, within the same project, config, runtime, etc?

@realkarimfahmy
Copy link
Author

Hi @Kritner,

yes the exception in Silo project that references the grain project in the password verifier

the exception is about Unable to load Orleans.SyncWork.ISyncWorker,Orleans.SyncWork from assembly Orleans.SyncWork.

if you have applied the same structure with the password verifier example you will get this exception
1- API
2- Grains
3- Silo

Orleans.SyncWork package installed in API and Silo

@Kritner
Copy link
Member

Kritner commented Oct 21, 2024

i started a PR to add an additional sample #61 while using separate client/silo projects. This does work, though i'm relying on the "project" reference instead of a "package" reference against the orleans.syncwork assembly.

i'm not sure if you'll be able to see any difference in setup, but i'm not really sure how to help w/o a repro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants