dotnet / dotnet/project-system
Support .env files
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Update the handling of Launch Profiles to support supplementing or overriding the environment variables specified in a launch profile with those in a .env file.
We generally expect launchSettings.json files, when present, to be checked in to source control. This make them unsuitable for storing private information, such as access tokens, usernames, passwords, etc., that may be needed during the development process. In the VS Code ecosystem this need is met through .env files which specify environment variable names and values. OmniSharp, for example, will automatically read this file and update the environment of the application on launch.
We should consider supporting .env files as well.
## Open Questions
- Do we really need this, or is the need already being met by some other tooling?
- Do we require the path to the .env file be specified, or do we support a default location (e.g. next to the solution file)?
- If we allow specifying the .env file, should that be on a per-profile basis, or in a global setting in the launchSettings.json?
## See Also
- [Definition in the launch.json schema](https://github.com/OmniSharp/omnisharp-vscode/blob/master/src/tools/OptionsSchema.json#L305)
- [.env file processing in omnisharp-vscode](https://github.com/OmniSharp/omnisharp-vscode/blob/master/src/coreclr-debug/ParsedEnvironmentFile.ts)
- #8189 (Note the request there is broader than what is covered by this issue.)
Contributor guide
Assessment
This issue has not been assessed yet.