CodeCarvings Piczard V1.2 Help
Example Config File (Web Project)
See Also Send Feedback
.Config File Settings > Example Config File (Web Project)

Glossary Item Box

Here is a example ASP.NET Web.Config file with the necessary definitions to fully utilize the Piczard Core and Web functions:

.NET Configuration Copy Code
<?xml version="1.0"?>
<
configuration>
 
<configSections>
   
<sectionGroup name="codeCarvings.piczard">
     
<section name="coreSettings" type="CodeCarvings.Piczard.Configuration.CoreSettingsSectionHandler, CodeCarvings.Piczard" requirePermission="false"/>
     
<section name="webSettings" type="CodeCarvings.Piczard.Configuration.WebSettingsSectionHandler, CodeCarvings.Piczard" requirePermission="false"/>
   
</sectionGroup>
 
</configSections>
 
<codeCarvings.piczard>
   
<coreSettings>
     
<drawing maxImageSize="5000, 5000" />
     
<imageArchiver defaultJpegQuality="92" defaultQuantizeGifImages="true" />
       
<security defaultEncryptionKey="Place here your random key (alphanumeric / 10..20 chars)" />
     
<plugins>
       
<!-- Register here your Piczard Plugins. -->
     
</plugins>
   
</coreSettings>
   
<webSettings>
     
<webResource enableCompression="true" />
     
<pictureTrimmer autoDeleteTemporaryFiles="true" />
     
<temporaryFileManager folderPath="~/App_Data" autoDeleteFiles="true" maxFileLifeTime="180" />
   
</webSettings>
 
</codeCarvings.piczard>
 
<location path="piczardWebResource.ashx">
   
<system.web>
     
<authorization>
       
<allow users="*" />
     
</authorization>
   
</system.web>
 
</location>
 
<system.web>
   
<httpHandlers>
     
<!-- Piczard - Important information: Remove or comment the following *add* line if you are using IIS 7/8 Integrated Pipeline Mode with validateIntegratedModeConfiguration = True (HTTP error 500.22/500.23). -->
     
<add verb="*" path="piczardWebResource.ashx" validate="false" type="CodeCarvings.Piczard.Web.WebResourceManager, CodeCarvings.Piczard" />
   
</httpHandlers>
 
</system.web>
 
<!--
       The system.webServer section is required for running ASP.NET AJAX under Internet
       Information Services 7/8.  It is not necessary for previous version of IIS.
 -->
 
<system.webServer>
   
<validation validateIntegratedModeConfiguration="false" />
   
<handlers>
     
<add name="PiczardWebResource" verb="*" path="piczardWebResource.ashx" preCondition="integratedMode" type="CodeCarvings.Piczard.Web.WebResourceManager, CodeCarvings.Piczard" />
   
</handlers>
 
</system.webServer>
</
configuration>

Please see also:

If at runtime you get the error: "Piczard client-side library failed to load", then please see: Piczard client-side library failed to load

 

 

Configuration - Point 1

Setup the configSections to manage "codeCarvings.piczard" tag Copy Code
<sectionGroup name="codeCarvings.piczard">
 
<section name="coreSettings" type="CodeCarvings.Piczard.Configuration.CoreSettingsSectionHandler, CodeCarvings.Piczard" requirePermission="false"/>
 
<section name="webSettings" type="CodeCarvings.Piczard.Configuration.WebSettingsSectionHandler, CodeCarvings.Piczard" requirePermission="false"/>
</
sectionGroup>

This part of configuration is mandatory.
It is necessary to allow the .NET application to manage the successive codeCarvings.piczard / coreSettings and webSettings tags within the Web.Config file (see "Configuration – Point 2"). 

 

 

Configuration - Point 2

Configuration example Copy Code
<codeCarvings.piczard>
 
<coreSettings>
   
...
 
</coreSettings>
 
<webSettings>
   
...
 
</webSettings>
</
codeCarvings.piczard>

This part of the configuration file contains the Piczard settings.
Please see:

 

 

Configuration - Point 3

Disable authentication for the Piczard HttpHandler Copy Code
<location path="piczardWebResource.ashx">
 
<system.web>
   
<authorization>
     
<allow users="*" />
   
</authorization>
 
</system.web>
</
location>
Piczard uses an HttpHandler to manage the resources used within the component.
The default handler name is "piczardWebResource.ashx", however it can be customized (please see Web Settings).
If the ASP.NET authentication system is used, it is possible that the framework stop the HttpHandler calls.
To avoid this problem, th piece of the configuration file can be used to disable authentication for the Piczard HttpHandler.
If the ASP.NET authentication is not used this piece is unnecessary.

 

 

Configuration - Point 4

Required only when using Microsoft IIS 6 -or- IIS 7/8 classic pipeline mode Copy Code
<system.web>
 
<httpHandlers>
   
<!-- Piczard - Important information: Remove or comment the following *add* line if you are using IIS 7/8 Integrated Pipeline Mode with validateIntegratedModeConfiguration = True (HTTP error 500.22/500.23). -->
   
<add verb="*" path="piczardWebResource.ashx" validate="false" type="CodeCarvings.Piczard.Web.WebResourceManager, CodeCarvings.Piczard" />
 
</httpHandlers>
</
system.web>

This piece of configuration allows the installation of the HttpHanlder used by Piczard when using IIS 6 -or- IIS 7/8 classic pipeline mode.
The default handler name is "piczardWebResource.ashx", however it can be customized (please see Web Settings).

If you are using IIS 7/8 integrated pipeline mode this part of the configuration is not necessary.
Instead, if  system.webServer / validation / validateIntegratedModeConfiguration is set to "true", an exception will be raised by ASP.NET.

In order to solve this problem you can:
Remove the http handler declaration from the system.web / httpHandlers section
- OR -
Set system.webServer / validation / validateIntegratedModeConfiguration to "false" (please see below).

 

 

Configuration - Point 5

Required only when using Microsoft IIS 7/8 - "Integrated pipeline mode" Copy Code
 <!--
       The system.webServer section is required for running ASP.NET AJAX under Internet
       Information Services 7/8.  It is not necessary for previous version of IIS.
 -->
 
<system.webServer>
   
<validation validateIntegratedModeConfiguration="false"/>
   
<handlers>
     
<add name="PiczardWebResource" verb="*" path="piczardWebResource.ashx" preCondition="integratedMode" type="CodeCarvings.Piczard.Web.WebResourceManager, CodeCarvings.Piczard" />
   
</handlers>
 
</system.webServer>

This piece of configuration allows the installation of the HttpHanlder used by Piczard when using IIS 7/8 integrated pipeline mode.
The default handler name is "piczardWebResource.ashx", however it can be customized (please see Web Settings).

system.webServer / validation / validateIntegratedModeConfiguration is an optional setting that allows to avoid problems when both the following conditions are true:

  1. The Piczard http handler has been registered both in system.web / httpHandlers -and in- system.webServer / handlers
  2. The application is running in IIS 7/8 integrated pipeline mode.

 

For more information please see: http://www.iis.net/ConfigReference/system.webServer/validation

See Also

©2013 Sergio Turolla. All Rights Reserved.