close

 

Complete Error Message:

 

An unhandled exception of type 'System.TypeInitializationException' occurred in PresentationFramework.dll

Additional information: 'System.Windows.Application' 的類型初始設定式發生例外狀況。

 

To solve this error, csn see this answer:

http://stackoverflow.com/questions/17132698/an-unhandled-exception-of-type-system-typeinitializationexception-occurred-in

 

Make sure that your config file (web.config if web, or app.config if windows) in your project starts as:

<?xml version="1.0"?>
<configuration>
    <configSections>
        <sectionGroup name="applicationSettings" 
                      type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >

            <section name="YourProjectName.Properties.Settings" 
                     type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 
                     requirePermission="false" />

        </sectionGroup>
    </configSections>
</configuration>

Note that inside the configuration element, the first child must be the configSections element.

 

 

also can see 

http://stackoverflow.com/questions/58425/wpf-application-fails-on-startup-with-typeinitializationexception

 

 

<configuration>
  <configSections>
    <section name="modules" type="Microsoft.Practices.Composite.Modularity.ModulesConfigurationSection, Microsoft.Practices.Composite"/>
  </configSections>
  <modules>
    <module assemblyFile="Modules/MyNamespace.Modules.ModuleName.dll" moduleType="MyNamespace.Modules.ModuleName.ModuleClass" moduleName="Name"/>
  </modules>
  <startup>
    <supportedRuntime version="v2.0.50727" sku="Client"/>
  </startup>
</configuration>

 

arrow
arrow
    全站熱搜

    olivermode 發表在 痞客邦 留言(0) 人氣()