When my Prism 6 modular WPF application using Unity starts then 'System.Configuration.ConfigurationErrorsException' in System.Configuration.dll is thrown. This exception is announcing that "'Prism.Modularity.ModulesConfigurationSection' type from 'Prism' assembly could not be loaded" and it throws when UnityBootstrapper.Run method is called in App.config file. Below is screen shot of exception (I have MSVS 2015 russified)
Below is the my application's Bootstrapper class:
class Bootstrapper : UnityBootstrapper
{
protected override DependencyObject CreateShell()
{
return Container.Resolve<MainWindow>();
}
protected override void InitializeShell()
{
Application.Current.MainWindow.Show();
}
protected override IModuleCatalog CreateModuleCatalog()
{
return new ConfigurationModuleCatalog();
}
}
I register all modules in App.config file of the main project of the solution. Please se below:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="modules" type="Prism.Modularity.ModulesConfigurationSection, Prism"/>
</configSections>
<modules>
<module assemblyFile="Authorization.dll" moduleType="Authorization.AuthorizationModule, Authorization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" moduleName="AuthorizationModule" startupLoaded="true" />
<module assemblyFile="Calibration.dll" moduleType="Calibration.CalibrationModule, Calibration, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" moduleName="CalibrationModule" startupLoaded="true" />
</modules>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
</configuration>
The main project was created with Prism Template Pack as Prism Unity App and the each module was created with Prism Template Pack as Prism Module. When my application starts then on the short moment (about 1 second) the application main window is displayed and after the above-mentioned exception is thrown. What should I correct in my application for eliminating the error? Please help.