Web Configuration File (web.config)
Web.config is the default configuration file of an IIS site. It is an XML document that provides numerous configuration possibilities for a web application. Let's dive deeper into the required sections and settings related to MixERP application configuration.
No Viewstate
Yes, that's right, no more ViewState craziness!!!
<system.web>
<pages enableViewState="false" enableViewStateMac="false" enableEventValidation="false" />
</system.web>
No Dynamic ClientID
Turn off the magic "dynamic ClientIDs" that ASP.net produces.
<system.web>
<pages clientIDMode="Static" />
</system.web>
Configure IIS to Serve *.backup Files
MixERP creates database backups using custom pg_dump format with zlib compression library. Since IIS does not understand how to serve *.backup file extension, an administrator has to ensure that the backup files are properly being served as static contents.
Create a static file handler for *.backup file extension
<system.webServer>
<handlers>
<add name="StaticHandler" verb="*" path="*.backup" type="System.Web.StaticFileHandler" preCondition="integratedMode" />
</handlers>
</system.webServer>
Create a Mime Map for *.backup file extension
<system.webServer>
<staticContent>
<mimeMap fileExtension=".backup" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
Register AttachmentFactory Upload Handlers and Services
AttachmentFactory exposes a couple of HTTP handlers and WebServices.
HTTP Handler
MixERP.Net.WebControls.AttachmentFactory.FileUploadHanlder
XML Web Service
MixERP.Net.WebControls.AttachmentFactory.Handlers.UploadService
Create Handlers
<system.webServer>
<handlers>
<add name="FileUploadHanlder" path="FileUploadHanlder.ashx" verb="*" type="MixERP.Net.WebControls.AttachmentFactory.FileUploadHanlder, MixERP.Net.WebControls.AttachmentFactory, Version=1.0.0.0, Culture=neutral" />
<add name="FileUploadService" path="FileUploadHanlder.asmx" verb="*" type="MixERP.Net.WebControls.AttachmentFactory.Handlers.UploadService, MixERP.Net.WebControls.AttachmentFactory, Version=1.0.0.0, Culture=neutral" preCondition="integratedMode" />
</handlers>
</system.webServer>
Configure AppSettings
The appSettings section is the one and only place that contains information about other configuration files.
<appSettings>
<add key="SupressMissingResourceException" value="true" />
<add key="DisplayErrorDetails" value="false" />
<add key="MaxInvalidPasswordAttempts" value="10" />
<add key="ReportAPIConfigFileLocation" value="/Resource/Configs/ReportApiConfiguration.config" />
<add key="DbServerConfigFileLocation" value="/Resource/Configs/DbServer.config" />
<add key="PartyControlConfigFileLocation" value="/Resource/Configs/PartyControlParameters.config" />
<add key="TransactionChecklistConfigFileLocation" value="/Resource/Configs/TransactionChecklistParameters.config" />
<add key="ParameterConfigFileLocation" value="/Resource/Configs/Parameters.config" />
<add key="ReportConfigFileLocation" value="/Resource/Configs/ReportParameters.config" />
<add key="StockTransactionFactoryConfigFileLocation" value="/Resource/Configs/StockTransactionFactoryParameters.config" />
<add key="UpdaterConfigFileLocation" value="/Resource/Configs/Updater.config" />
</appSettings>
SupressMissingResourceException
Set this true if you want to supress "MissingManifestResourceException" when an i18n resource key is not found. Turn this on (true) on production site.
DisplayErrorDetails
Set this to true if you do not want to display the complete exception stack trace to the application user. Turn this off (false) on production site.
MaxInvalidPasswordAttempts
Maximum number of invalid password attempts, after which no more sign in attempt will be allowed.
APIConfigFileLocation .. SwitchConfigFileLocation
The path of configuration files relative to web application root directory.