diff --git a/src/ImageProcessor.Web/Configuration/ImageProcessingSection.cs b/src/ImageProcessor.Web/Configuration/ImageProcessingSection.cs
index 6c2926c29..cbed1468d 100644
--- a/src/ImageProcessor.Web/Configuration/ImageProcessingSection.cs
+++ b/src/ImageProcessor.Web/Configuration/ImageProcessingSection.cs
@@ -11,13 +11,11 @@
namespace ImageProcessor.Web.Configuration
{
- #region Using
using System.Configuration;
using System.IO;
using System.Linq;
using System.Xml;
using ImageProcessor.Web.Helpers;
- #endregion
///
/// Represents an image processing section within a configuration file.
@@ -26,7 +24,6 @@ namespace ImageProcessor.Web.Configuration
public sealed class ImageProcessingSection : ConfigurationSection
{
#region Properties
-
///
/// Gets or sets a value indicating whether to preserve exif meta data.
///
@@ -66,6 +63,11 @@ namespace ImageProcessor.Web.Configuration
return this["plugins"] as PluginElementCollection;
}
}
+
+ ///
+ /// Gets or sets a value indicating whether to auto load plugins.
+ ///
+ public bool AutoLoadPlugins { get; set; }
#endregion
#region Methods
@@ -80,6 +82,7 @@ namespace ImageProcessor.Web.Configuration
if (imageProcessingSection != null)
{
+ imageProcessingSection.AutoLoadPlugins = false;
return imageProcessingSection;
}
@@ -87,7 +90,7 @@ namespace ImageProcessor.Web.Configuration
XmlReader reader = new XmlTextReader(new StringReader(section));
imageProcessingSection = new ImageProcessingSection();
imageProcessingSection.DeserializeSection(reader);
-
+ imageProcessingSection.AutoLoadPlugins = true;
return imageProcessingSection;
}
#endregion
@@ -251,19 +254,6 @@ namespace ImageProcessor.Web.Configuration
///
public class PluginElementCollection : ConfigurationElementCollection
{
- ///
- /// Gets or sets a value indicating whether to auto load all plugins.
- /// Defaults to True.
- ///
- /// If True plugins are auto discovered and loaded from all assemblies otherwise they must be defined in the configuration file
- [ConfigurationProperty("autoLoadPlugins", DefaultValue = true, IsRequired = false)]
- public bool AutoLoadPlugins
- {
- get { return (bool)this["autoLoadPlugins"]; }
-
- set { this["autoLoadPlugins"] = value; }
- }
-
///
/// Gets the type of the .
///
diff --git a/src/ImageProcessor.Web/Configuration/ImageProcessorConfiguration.cs b/src/ImageProcessor.Web/Configuration/ImageProcessorConfiguration.cs
index 69bc77b7a..4846c61ea 100644
--- a/src/ImageProcessor.Web/Configuration/ImageProcessorConfiguration.cs
+++ b/src/ImageProcessor.Web/Configuration/ImageProcessorConfiguration.cs
@@ -188,7 +188,7 @@ namespace ImageProcessor.Web.Configuration
{
if (this.GraphicsProcessors == null)
{
- if (GetImageProcessingSection().Plugins.AutoLoadPlugins)
+ if (GetImageProcessingSection().AutoLoadPlugins)
{
Type type = typeof(IWebGraphicsProcessor);
try
@@ -291,7 +291,7 @@ namespace ImageProcessor.Web.Configuration
{
if (this.ImageServices == null)
{
- if (GetImageSecuritySection().ImageServices.AutoLoadServices)
+ if (GetImageSecuritySection().AutoLoadServices)
{
Type type = typeof(IImageService);
try
diff --git a/src/ImageProcessor.Web/Configuration/ImageSecuritySection.cs b/src/ImageProcessor.Web/Configuration/ImageSecuritySection.cs
index dd47c9ac5..c99fcb3ae 100644
--- a/src/ImageProcessor.Web/Configuration/ImageSecuritySection.cs
+++ b/src/ImageProcessor.Web/Configuration/ImageSecuritySection.cs
@@ -37,6 +37,11 @@ namespace ImageProcessor.Web.Configuration
return o as ServiceElementCollection;
}
}
+
+ ///
+ /// Gets or sets a value indicating whether to auto load services.
+ ///
+ public bool AutoLoadServices { get; set; }
#endregion
#region Methods
@@ -50,6 +55,7 @@ namespace ImageProcessor.Web.Configuration
if (imageSecuritySection != null)
{
+ imageSecuritySection.AutoLoadServices = false;
return imageSecuritySection;
}
@@ -57,7 +63,7 @@ namespace ImageProcessor.Web.Configuration
XmlReader reader = new XmlTextReader(new StringReader(section));
imageSecuritySection = new ImageSecuritySection();
imageSecuritySection.DeserializeSection(reader);
-
+ imageSecuritySection.AutoLoadServices = true;
return imageSecuritySection;
}
#endregion
@@ -139,19 +145,6 @@ namespace ImageProcessor.Web.Configuration
///
public class ServiceElementCollection : ConfigurationElementCollection
{
- ///
- /// Gets or sets a value indicating whether to auto load all plugins.
- /// Defaults to True.
- ///
- /// If True plugins are auto discovered and loaded from all assemblies otherwise they must be defined in the configuration file
- [ConfigurationProperty("autoLoadServices", DefaultValue = true, IsRequired = false)]
- public bool AutoLoadServices
- {
- get { return (bool)this["autoLoadServices"]; }
-
- set { this["autoLoadServices"] = value; }
- }
-
///
/// Gets the type of the .
///
diff --git a/src/ImageProcessor.Web/Configuration/Resources/processing.config b/src/ImageProcessor.Web/Configuration/Resources/processing.config
index 8be8188c9..4b6851a03 100644
--- a/src/ImageProcessor.Web/Configuration/Resources/processing.config
+++ b/src/ImageProcessor.Web/Configuration/Resources/processing.config
@@ -1,7 +1,7 @@
-
+
diff --git a/src/ImageProcessor.Web/Configuration/Resources/security.config b/src/ImageProcessor.Web/Configuration/Resources/security.config
index 5326f270f..86e92d567 100644
--- a/src/ImageProcessor.Web/Configuration/Resources/security.config
+++ b/src/ImageProcessor.Web/Configuration/Resources/security.config
@@ -1,5 +1,5 @@
-
+
diff --git a/src/TestWebsites/MVC/config/imageprocessor/processing.config b/src/TestWebsites/MVC/config/imageprocessor/processing.config
index 633325459..521d082d9 100644
--- a/src/TestWebsites/MVC/config/imageprocessor/processing.config
+++ b/src/TestWebsites/MVC/config/imageprocessor/processing.config
@@ -1,7 +1,7 @@
-
+
diff --git a/src/TestWebsites/MVC/config/imageprocessor/security.config b/src/TestWebsites/MVC/config/imageprocessor/security.config
index b49f89854..dc9d8fe95 100644
--- a/src/TestWebsites/MVC/config/imageprocessor/security.config
+++ b/src/TestWebsites/MVC/config/imageprocessor/security.config
@@ -1,6 +1,6 @@
-
+