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

Load Akka Config from App.config automatically #671

Closed
Aaronontheweb opened this issue Feb 23, 2015 · 9 comments
Closed

Load Akka Config from App.config automatically #671

Aaronontheweb opened this issue Feb 23, 2015 · 9 comments

Comments

@Aaronontheweb
Copy link
Member

I would love to be able to remove the following boilerplate code from Akka.NET apps if possible:

var section = (AkkaConfigurationSection)ConfigurationManager.GetSection("akka");
var config = section.AkkaConfig;
var actorSystem = ActorSystem.Create("MySystem", config);

And just have the following call, which would automatically load configuration sections in via ConfigurationManager:

var actorSystem = ActorSystem.Create("MySystem");

Any objections to this?

@nvivo
Copy link
Contributor

nvivo commented Feb 23, 2015

I think this makes sense.

Also, very soon the internal behavior will probably need some change to work with the new config providers from asp.net vnext, that don't require xml files. In that case, akka can load the settings directly from some hocon file with some config.AddHoconFile('akka.config').

@rogeralsing
Copy link
Contributor

This is already how it works...

@rogeralsing
Copy link
Contributor

@Aaronontheweb
Copy link
Member Author

@rogeralsing here's what ConfigurationFactory.Load() currently does:

 var section = new AkkaConfigurationSection();
 Config config = section.AkkaConfig;

return config;

https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka/Configuration/ConfigurationFactory.cs#L38

This returns a blank Config, not the Config stored in App.Config or Web.config.

Needs to be changed to using the ConfigurationManager to load from App.config.

@rogeralsing
Copy link
Contributor

Ohhh. that is a bug in that case.

@Aaronontheweb
Copy link
Member Author

I'm having Bootcamp attendees use this in Unit 2 - would love to have a hotfix for this for them in the near future :p

@ejohn54
Copy link

ejohn54 commented Mar 12, 2020

This is broken in the latest release of Akka.Net 1.4.1. Please reopen this issue. It is no longer automatically loading the akka section in the app.config file. Reverting back to 1.3.18 works fine.

@Aaronontheweb
Copy link
Member Author

Aaronontheweb commented Mar 12, 2020 via email

@Aaronontheweb
Copy link
Member Author

I took care of it - #4330

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

No branches or pull requests

4 participants