How to get “Manage User Secrets” in a .NET Core console-application?

前端 未结 9 1365
醉梦人生
醉梦人生 2020-12-28 12:07

When I create a new ASP .NET Core Web-Application, I can right-click the project in Visual Studio, and I see a context-menu entry called \"Manage User Secre

9条回答
  •  礼貌的吻别
    2020-12-28 12:19

    How to get “Manage User Secrets” in a .NET Core console-application?

    Using Visual Studio 2015 Community with update 3

    1. File -> New-> Project
    2. Select Console Application (.NET Core)
    3. Press CTRL+ALT+L
    4. Click on the project to get “Manage User Secrets” it will open up a file called secrets.json

    and where you can manually enter user-secrets.

    I was able to use command prompt to setup user secrets:

    c:\Projects\ConsoleApp2\src\ConsoleApp2>dotnet user-secrets set BrainTree_sandbox:Merchant ID:9rv9mhnb5gh7nnyx

提交回复
热议问题