1. In Visual studio select the ClientApp then set the target CPU architecture to match your system’s architecture (x86 / x64…).

  2. Choose a safe place to temporarily store the certificate generated in the next step then right click and select “Open in Terminal” or CD into that folder (Run command Prompt as Admin may be necessary - untested as yet).

  3. Run the command: "dotnet dev-certs https --export-path ./sidekickapp.pfx --password sidekickapp!@#"

  4. Double click on the certificate and install it for Current User.

  5. Back in Command prompt run: "dotnet dev-certs https --trust"

  6. Win Key + R and run: "certmgr.msc"

  7. In certmgr check the certificate is successfully installed as in the below image with 1 year from your current date as an expiry date on the new certificate...

  8. Select the server app in the solution explorer then in the developer console (ensuring that the file path points to the server app) run:

    1. sqllocaldb create MyLocalDB
    2. sqllocaldb start MyLocalDB
    3. sqllocaldb info MyLocalDB
    4. Replace “[Pipe_Name]” with the pipe name from the info block then run the command: "sqlcmd -S [PIPE_NAME] -Q "CREATE DATABASE SidekickApp_WebAPIDb""
      1. Alternatively step by step as follows:
        1. "sqlcmd -S [PIPE_NAME]"
        2. "CREATE DATABASE SidekickApp_WebAPIDbGO"
    5. Test that the DB was created successfully by running: "SELECT name FROM sys.databases GO"
  9. If dotnet-ef hasn’t already been installed then run: “dotnet tool install --global dotnet-ef“

  10. CD into the SidekickApp_WebAPI project folder.

  11. Set the WebAPI project as the EF startup project by running: “dotnet ef migrations list --project [PathToYourProject.csproj] --startup-project [PathToYourStartupProject]“

  12. Run the migrations: “dotnet ef database update --startup-project [project path]”

  13. Run the Insert into the AspNetUserTokens table using the attached inserts.

  14. Use Visual studio’s SQL Server Object explorer to ensure that in the AspNetUserTokens table the row containing the “user1” record has the value “1234567890“ in the SLT column.

  15. Set your JWT_SECRET_KEY by going into your PC’s Environment variables and adding it manually as a System variable

    image.png

AspNetUserTokens Table inserts.txt