0

IHello everyone, I have a small problem, maybe someone can help me, i want to use dotnet user-secrets tool when i'm developing my .net core web app. I am done everything i read here: https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets. In this doc there is a tutorial for .net core with csproj files but i have project.json, i worked it out but when i try to type in command prompt 'dotnet user-secrets list' in my prject folder i only get:

Could not find a MSBuild project file in 'C:\WebApp\src\WebApp'. Specify which project to use with the --project option.

I tried it with --project option but i got the same, did i forget to do something ? Here You have part of my project.json

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
    "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0", 

    .......

    },

    .....

  "tools": {
    ...
    "Microsoft.Extensions.SecretManager.Tools": "1.0.0-msbuild3-final"
  },

  "userSecretsId": "ee5f10b0-829f-4257-9024-e5ee6e085823",

  ......
}
Bonus
  • 43
  • 1
  • 7

1 Answers1

1

i have just found a solution of my problem, i was trying to use the newest version of user-secrets tool which works good with projects which have *.csproj files. I still have project.json files, and if i stay with my VS2015 i have to stay with *.json files ( I read somewhere that installation of new VS2017 is required for using *.csproj files in .net core - correct me if I'm wrong). I found a nice tutorial: https://www.janaks.com.np/user-secret-management-asp-net-core/ , I followed the instructions and use exactly the same versions of user-secrets tool and the same version of userSecrets dependency with my sdk version in global.json:

"sdk": {
    "version": "1.0.0-preview2-003121"
  }

now everything works fine :)

Bonus
  • 43
  • 1
  • 7
  • thanks for this! Works for me. One thing I noticed: is that it gave me a warning that this particular version didn't exist but it auto-switched to: 1.0.0-preview2-final – James Scott Mar 27 '17 at 14:44