'How can I embed a variable on build from a text file I read?
I am working on C# winform application and I had setup .env files with this package https://github.com/tonerdo/dotnet-env, the problem is I can't access my database credentials which I included inside my .env file on my application compiled production version because basically I didn't include the .env file production, so I want to set my .env variables as a variable in my application when I get to build. I tried it but still, my code references the .env file so I can't figure out how can I do it.
static string conStr = GetEnvironmentVariable("ConnectionString");
public static MySqlConnection conn = new MySqlConnection(conStr);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|