You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.IO.FileNotFoundException
The configuration file '.env' was not found and is not optional.
at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
The text was updated successfully, but these errors were encountered:
This is happening because by default, the FileConfigurationSource excludes dot-prefixed files, hidden files, and system files from being read into the configuration.
I've opened an issue on the .NET runtime repo asking why this is the case. dotnet/runtime#54712
When using the
.AddEnvFile(string)
method, specifying a.env
file, aFileNotFoundException
is always returned.Example:
Stacktrace:
The text was updated successfully, but these errors were encountered: