tonerdo / dotnet-env

A .NET library to load environment variables from .env files
MIT License
427 stars 50 forks source link

Add ConfigurationProvider to integrate with standard .NET providers #71

Closed cdroulers closed 1 year ago

cdroulers commented 1 year ago

Hello!

My colleague is super in love with your lib and it's great! I wanted to get it working with the .NET ConfigurationBuilder, so here's a small PR that wraps everything needed for it to work, including unit tests!

I put it in the same projet, which adds two references to Microsoft.Extensions.Configuration and Microsoft.Extensions.Configuration.Abstractions. It could also be split in a different project and packaged separately if you think it's too many deps that won't be used! (although they are included in most new projects by Visual Studio!)

README was updated!

Comments EXPECTED! :D

cdroulers commented 1 year ago

I fixed the build in appveyor as well!

mrbergeron83 commented 1 year ago

YESSSSS

rogusdev commented 1 year ago

Thanks for this! I will maybe take a look today, but soon

cdroulers commented 1 year ago

@rogusdev I've just pushed one more commit that makes each test class run in sequence. Otherwise, both test classes would set some environment variables and cause some assert errors!

cdroulers commented 1 year ago

@rogusdev I made sure to use the version of Microsoft.Extensions.Configuration that was compatible with .netstandard1.2 or whichever was already targeted!

rogusdev commented 1 year ago

Thanks. New version has your changes then, go ahead and upgrade :)