How to find path of active app.config file?

后端 未结 8 2032
被撕碎了的回忆
被撕碎了的回忆 2020-12-02 04:43

I\'m trying to finish this exception handler:

if (ConfigurationManager.ConnectionStrings[\"ConnectionString\"]==null)
{
    string pathOfActiveConfigFile = .         


        
8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 05:35

    Depending on the location of your config file System.Reflection.Assembly.GetExecutingAssembly().Location might do what you need.

提交回复
热议问题