SORU
27 NİSAN 2009, PAZARTESİ


Nasıl aktif uygulama yolunu bulmak için.yapılandırma dosyası?

Bu özel durum işleyicisi bitirmeye çalışıyorum:

if (ConfigurationManager.ConnectionStrings["ConnectionString"]==null)
{
    string pathOfActiveConfigFile = ...?
    throw new ConfigurationErrorsException(
       "You either forgot to set the connection string, or "  
       "you're using a unit test framework that looks for  " 
       "the config file in strange places, update this file : " 
         pathOfActiveConfigFile);
}

Bu sorun sadece nUnit kullanıyorum benim başıma geliyormuş gibi görünüyor.

CEVAP
27 NİSAN 2009, PAZARTESİ


Bu deneyin

AppDomain.CurrentDomain.SetupInformation.ConfigurationFile

Umarım yardımcı olur

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Jorrit Jongma

    Jorrit Jongm

    17 Ocak 2008
  • sghaff1

    sghaff1

    23 Mart 2009
  • TastyTuts | Creative video tutorials by Gareth David

    TastyTuts |

    6 Temmuz 2011