none
System.Configuration.ConfigurationErrorsException

    Pytanie

  • i am getting the following error when deploying in production, whereas it runs fine in all other machines, please let me know what could be the possible problem.

    System.Configuration.ConfigurationErrorsException: An error
     occurred creating the configuration section handler for appSettings: Could not
    load file or assembly 'System.Configuration, Version=4.0.0.0, Culture=neutral, P
    ublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot fi
    nd the file specified. (C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Config\m
    achine.config line 14) ---> System.IO.FileNotFoundException: Could not load file
     or assembly 'System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyT
    oken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the fi
    le specified.
    File name: 'System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyTok
    en=b03f5f7f11d50a3a'
       at System.Configuration.TypeUtil.GetTypeWithReflectionPermission(IInternalCon
    figHost host, String typeString, Boolean throwOnError)
       at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactor
    y.Init(RuntimeConfigurationRecord configRecord, FactoryRecord factoryRecord)
       at System.Configuration.RuntimeConfigurationRecord.RuntimeConfigurationFactor
    y.InitWithFullTrust(RuntimeConfigurationRecord configRecord, FactoryRecord facto
    ryRecord)
       at System.Configuration.RuntimeConfigurationRecord.CreateSectionFactory(Facto
    ryRecord factoryRecord)
       at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(St
    ring configKey, Boolean& isRootDeclaredHere)

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\M
    icrosoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure lo
    gging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fus
    ion!EnableLog].

       --- End of inner exception stack trace ---
       at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(St
    ring configKey, Boolean& isRootDeclaredHere)
       at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String co
    nfigKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Bool
    ean requestIsHere, Object& result, Object& resultRuntimeObject)
       at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
       at System.Configuration.ClientConfigurationSystem.System.Configuration.Intern
    al.IInternalConfigSystem.GetSection(String sectionName)
       at System.Configuration.ConfigurationManager.GetSection(String sectionName)
       at System.Configuration.ConfigurationManager.get_AppSettings()
       at System.Configuration.ConfigurationSettings.get_AppSettings()
       at CPExpressMigrationToLMS.AppConfigReader.getBundleToBundleXmlFolderPath()
       at LMSMigration.Program.FixBundleDomain()

    • Przeniesiony przez edhickeyModerator 6 września 2011 16:49 (From:.NET 3.0/3.5 Windows Workflow Foundation)
    2 września 2011 03:14

Odpowiedzi

  • I found the solution, in my App.config file, i have the following

      <startup>
        <supportedRuntime version="v2.0.50727"/>
      </startup>

    and since my production environment as the most recent version .net i changed it to the following it worked fine

      <startup>
        <supportedRuntime version="v4.0.30319"/>
      </startup>

     

    probably v2.0.50727 was corrupted or something.

     

     

    • Oznaczony jako odpowiedź przez Sarav M 2 września 2011 17:27
    2 września 2011 17:26