How to configure mail settings <system.net><mailSettings> that used to be in web.config in asp.net 4? I guess I need to call services.Configure<>() but I have no idea what options I should pass. Any ideas?
Thanks, f0rt
How to configure mail settings <system.net><mailSettings> that used to be in web.config in asp.net 4? I guess I need to call services.Configure<>() but I have no idea what options I should pass. Any ideas?
Thanks, f0rt
Try this as a way to keep your secrets secret. First, install the
SecretManagerand configure it with your secrets. When you're on your local machine, you'll want to use values from theSecretManager. With your hosting (e.g. in Azure) you'll use environmental variables.Local: Install and Configure the
SecretManagerThere's a bug that makes this go awry if you have VS 2015 RC installed. There's a workaround here.
Live: Use Environmental Variables
Here's an example in a MS Azure Web App, though other web hosts probably have similar options.
project.json
Note that we're targeting only
dnx451. Also, we have auserSecretsId.Startup.cs
Now you can access those user secrets locally, and when environmental variables will overwrite them when available. I've just tested this minimal project. It works.
See also:
DNX Secret Configuration
Rick Anderson's Draft on App Secrets