Ryuji
Ryuji

Reputation: 33

How to install DNX Secret Manager in Mac OSX

I'm developing with ASP.NET5 on Mac OS X. I want to implement OAuth and use Secret Manager to store my secret configuration, so I'm following this DNXSecret Configuration page. https://github.com/aspnet/Home/wiki/DNX-Secret-Configuration

But, after following the instructions, I couldn't successfully install user-secret command to my Mac, and I'm pretty much stuck.

As the first step, I installed DNVM and confirmed dnvm list command returns Mono as the runtime engine.

$ dnvm list
Active Version              Runtime Arch Location             Alias
------ -------              ------- ---- --------             -----
  *    1.0.0-beta4          mono         ~/.dnx/runtimes      default

I also installed Yeoman, Grunt, Bower etc, and dnu restore command worked fine. I successfully showed a Yeoman scaffolded ASP.NET5 page both locally and on Azure.

Then I started to install Secret Manager, following the above page. In the beginning, the following command failed:

dnu commands install SecretManager

with the error below:

Errors in /Users/<username>/.dnx/bin/packages/SecretManager/1.0.0-beta4/app/project.json
Unable to locate SecretManager >= 1.0.0-beta4-10173

So, I modified the above 'project.json' file in its "dependencies" block as:

{
  "version": "1.0.0-*",
  "description": "ASP.NET 5 tool to manage user secrets.",
  "dependencies": {
    "SecretManager": "1.0.0-beta4"    // <<- modified here
    //"SecretManager": "1.0.0-beta4-10173"
  },
  "commands": {
    "user-secret": "SecretManager"
  },
  "userSecretsId": "testuserSecretsId",
  "frameworks": {
    "dnx451": {},
    "dnxcore50": {
      "dependencies": {
        "System.Console": "4.0.0-beta-*"
      }
    }
  },
  "entryPoint": "SecretManager",
  "loadable": false
}

(before) "SecretManager": "1.0.0-beta4-10173"
(after) "SecretManager": "1.0.0-beta4"

Then the command finished successfully and SecretManager seems to be installed with the result below:

konishis-air:AspNetSocialLoginTest Ryuji$ dnu commands install SecretManager
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='SecretManager'.
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='SecretManager' 1674ms
Restoring packages for /Users/Ryuji/.dnx/bin/packages/e27d166dcf594105be47fff78420df10/project.json
Writing lock file /Users/Ryuji/.dnx/bin/packages/e27d166dcf594105be47fff78420df10/project.lock.json
Restore complete, 246ms elapsed
Restoring packages for /Users/Ryuji/.dnx/bin/packages/SecretManager/1.0.0-beta4/app/project.json
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Console'.
  OK https://www.nuget.org/api/v2/FindPackagesById()?Id='System.Console' 1395ms
Writing lock file /Users/Ryuji/.dnx/bin/packages/SecretManager/1.0.0-beta4/app/project.lock.json
Restore complete, 1751ms elapsed
The following commands were installed: .project.json, user-secret

However, when I run user-secret command, I get 'command not found'.

Upvotes: 1

Views: 706

Answers (1)

Victor Hurdugaci
Victor Hurdugaci

Reputation: 28425

Sorry, that is a known issue and we've fixed in beta5.

You have two options:

  1. Pass the fallback source: dnu commands install secretmanager 1.0.0-beta4 -f https://www.myget.org/F/aspnetrelease/api/v2
  2. Update to the latest beta5 bits

Upvotes: 2

Related Questions