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

Grain not found if in same project #4417

Closed
dandago opened this Issue Apr 7, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@dandago
Contributor

dandago commented Apr 7, 2018

I'm following the Hello World sample documentation. But rather than build a full project structure (as the actual code sample does), I'm dumping everything (silo, client, grain and interface) in the same console app. This is because I want to keep it simple, and not complicate an introductory exercise with additional infrastructure. First I make it work, then I make it nice.

Unfortunately, the "make it work" part didn't play out very nicely. The grain is not being found, even though it sits literally in the same file as the Main() method.

image

According to the Server Configuration documentation, this should work without the need for additional configuration:

"Although this step is not technically required (if not configured, Orleans will scan all assembly in the current folder), developers are encouraged to configure this. This step will help Orleans to load user assemblies and types."

However, I have also tried .ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(HelloGrain).Assembly).WithReferences()) and .ConfigureApplicationParts(parts => parts.AddFromAppDomain()) and I still get the same error.

I am attaching a repro project.

Orleans2TestDrive.zip

@ReubenBond

This comment has been minimized.

Contributor

ReubenBond commented Apr 8, 2018

Make sure you add the code generation package

@dandago

This comment has been minimized.

Contributor

dandago commented Apr 8, 2018

Yes, that solved it.

Install-Package Microsoft.Orleans.OrleansCodeGenerator.Build

So it is required now, and there is no default if you don't install a codegen package?

@ReubenBond

This comment has been minimized.

Contributor

ReubenBond commented Apr 9, 2018

That's correct, @dandago, there is no default.
For all intents and purposes, that package is required

@dandago

This comment has been minimized.

Contributor

dandago commented Apr 10, 2018

Very good, I think we can close this, unless there's any need to update the docs to make this more clear.

@ReubenBond ReubenBond closed this Apr 10, 2018

@ReubenBond

This comment has been minimized.

Contributor

ReubenBond commented Apr 10, 2018

Thank you, @dandago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment