passing license keys to a unit test
I would like to use a 3rd party DLL which needs a license key passed in, however I cannot find a way to do this, as the unit test project seems to ignore
launchSettings.json
, and I don't want to hard-code the key anywhere in the test itself.
on Live this comes from an environment variable7 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
a PDF library which needs me to explicity call something like
setLicence(keyHere)
it's for an integration test i suppose, technically, as it is the first step to producing a secondary list of thingsUnknown User•3y ago
Message Not Public
Sign In & Join Server To View
i feed it a PDF, it produces a thing, then I do stuff with that thing
appsettings does work, ill just have to be careful to add those ones to gitignore
Check out UserSecrets
It gives you a config file stored in your profile, basically
actually that's what im using elsewhere for another project, can check in blank values for the appsettings then 👌 (just to let other devs know theyre needed)
If you're using user secrets, user secrets is driven by the id, so for instance two projects can use the same id; user secrets also have nothing to do with your code, so you can share them across multiple solutions as well if it makes sense to do so.