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

I can't find a way to set the environment to Development which injects the user secrect configuration source #10836

Open
jotabe-net opened this issue Jan 12, 2025 · 1 comment
Labels
area-System.Runtime untriaged New issue has not been triaged by the area owner

Comments

@jotabe-net
Copy link

Type of issue

Missing information

Description

I'm trying to get the User Secrects configuraiton source included, as explained in this comment:

load app IConfiguration from User Secrets when EnvironmentName is 'Development' using the entry assembly

but I have no idea what this means:

is 'Development' using the entry assembly

Trying this:

  var builder = Host.CreateApplicationBuilder(new HostApplicationBuilderSettings
  {
      EnvironmentName = Environments.Development,
  });

has no effect. And setting directly the environment name, neither works:

builder.Environment.EnvironmentName = "Development";

I have no idea, and can't fin in the docuemntation, how to set the environment in a different way.

NOTE: I want to use this for a template using host, so, ideally, this should be done by copde, and not depend on some confiuration that can be changed or verwritten.

Thnak you!

Page URL

https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.hosting.host.createapplicationbuilder?view=net-9.0-pp

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/Microsoft.Extensions.Hosting/Host.xml

Document Version Independent Id

f1673a77-ddda-383d-57a6-8403758c5271

Article author

@dotnet-bot

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jan 12, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

1 participant