Skip to content

Instantly share code, notes, and snippets.

@PureKrome
Last active August 16, 2021 03:28
Show Gist options
  • Save PureKrome/c683d623ead15aeeb4cdc80702ea4b63 to your computer and use it in GitHub Desktop.
Save PureKrome/c683d623ead15aeeb4cdc80702ea4b63 to your computer and use it in GitHub Desktop.
Debugging .NET Core external code from a private GitHub repo

HOWTO: Debug .NET Core external code from a 🔒 private GitHub repository, using JetBrains Rider

GITHUB: Create a GitHub "PAT" (Personal Access Token)

To access any locked/private resources in GitHub, you need a PAT. This is a specific access key that you can create to unlock whatever resource you own.

  • Login to GitHub
  • Click on your avatar icon (top right corner) -> Settings
  • Now click Developer Settings -> Personal Access Tokens
  • Click "Generate New Token" button
  • Give it some name/description in the "Note" textbox. E.g. Rider External Sources PAT
  • Decide on an expiration.
  • Check/tick the repo scope
  • Click "generate token" at the bottom of the page.
  • WARNING: copy this secret password-PAT thingy. Once it disappears, you cannot see it again. (If that happens, then you will need to repeat the above PAT-steps, again).

RIDER: Enable external sources

CODE: Start debugging your code

  • Add a breakpoint to some code which is located inside the external library.
  • Run app
  • Step into this method (from the external library)
  • You should get an error -> 404 file cannot be found.
  • In the same error message dialogue, click "Authenticate"
  • Enter your GitHub credentials: GitHub username and PAT-password text (generated, just above)
  • Retry and see if this works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment