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

  • Hollyscoop

    Hollyscoop

    30 Ocak 2007
  • SketchBookPro

    SketchBookPr

    6 Mayıs 2009
  • TouchePro

    TouchePro

    27 EYLÜL 2007