Questions tagged [user-secret]
13 questions
1
vote
0 answers
User Secrets not loading with WebApplication.CreateBuilder(args)
My understanding from the Microsoft documentation is the userSecret configuration is supposed to be automatically created by the WebApplication.CreateBuilder() while in the development environment. This is not true for my current WebAPI .net7…

kevin
- 338
- 2
- 13
1
vote
1 answer
How do I get .NET Feature Management to use config in User Secrets?
I've got an ASPNET Core web app (.NET 6). I have User Secrets enabled and Feature Management enabled.
I would like to override some flags in my user secrets. However, by default, Feature Management reads from the FeatureManagement section of config,…

Steve Dunn
- 21,044
- 11
- 62
- 87
1
vote
0 answers
ASP.NET Core - User Secrets per Git Branch
Is it possible to have different sets of user-secrets per git branch?
So that when switching from feature-branch-1 to feature-branch-2 you would pick up different sets of configuration? (ConnectionStrings, etc)
It seems like a fairly common use…

Ted
- 2,525
- 2
- 37
- 54
1
vote
1 answer
C# - Using user-secrets import in all class of a project
I've written a console app using user-secrets:
var configuration = new ConfigurationBuilder()
.AddUserSecrets()
.Build();
Console.WriteLine("Hello,…

Mario Rovelli
- 29
- 5
1
vote
1 answer
Manage User Secrets in a custom config file
I have a Xamarin.Forms app. As it does not have built in configuration file, I used a solution found here:
https://www.andrewhoefling.com/Blog/Post/xamarin-app-configuration-control-your-app-settings
and…

David Shochet
- 5,035
- 11
- 57
- 105
1
vote
1 answer
How to use .NET Core secrets in .sh file that is called from docker-compose
Background
I am writing a .NET 5 application and using .net user secrets for my secret keys (database connections & passwords).
Recently I decided to learn Dockers and update my application to work with it so that using Visual Studio I generated a…

Misha Zaslavsky
- 8,414
- 11
- 70
- 116
0
votes
1 answer
.net7 Web API User Secrets not loading
I have followed the instructions as per the Microsoft Documentation.
the secrets are not loading for some reason. I'm MacOS using Visual Studio
I tried adding manually using builder.Configuration.AddUserSecrets();

CMyd
- 1
- 1
0
votes
0 answers
Upgrading to .Net 6 User Secrets
We currently use .Net Framework 4.8 but are upgrading Windows console apps to .Net 6.0. In 4.8, we would use Microsoft.Configuration.ConfigurationBuilders.UserSecrets to help manage keys in our app.config that we wanted to keep secret(production…

Gary Turpin
- 81
- 3
0
votes
0 answers
How do I correctly update my EF Core context to use secrets.json instead of a hard-coded connection string?
It's very unclear how to do this.
I have seen examples that say you can use IConfiguration, some that manually load the secrets.json (but if that's the case, why does it insert metadata into the csproj specifically about secret stores?).
Either way,…

NibblyPig
- 51,118
- 72
- 200
- 356
0
votes
0 answers
Specflow test runsettings & usersecrets
I have some specflow tests which use runsettings files to pass parameters through to the test cases and some of these parameters are secrets.
In our build pipeline & release pipelines on ADO I have it figured out that I can choose the run settings…

Webezine
- 345
- 7
- 22
0
votes
1 answer
grab UserSecrets from a NuGet package
I've written a C# class library for my company to use internally, and it uses DotNet UserSecrets to allow each developer to have their own credentials set without needing to worry about accidentally committing them. It worked fine during testing,…

Jeremy Meadows
- 2,314
- 1
- 6
- 22
0
votes
0 answers
Azure function startup (.net core 5, runtime v3) occurs well before Program.Main
I'm using .NET 5.0, Azure runtime 3.
I have an Azure function that triggers based on a service bus. The function declaration looks like:
[FixedDelayRetry(0, "00:00:00")]
[Function("MyFunkyFunc")]
public async Task Run(
…

user2845090
- 147
- 3
- 14
0
votes
1 answer
Does .Net Core can change User Secret based on Environment in launch settings?
On my dev machine I store connection strings in all of my Appsettings{environment}.json files.
When I have some kind of problem in Production environment I change the launch.settings file to Production and then I can debug the solution using…

Offir
- 3,252
- 3
- 41
- 73