Tag: ASP.NET

  • IIS 7.5 Error The temp directory in chart handler configuration is not accessible

    If you build a web application with Chart control for ASP.NET 4.0 and deploy the site to web server.  You might get following error on the live site:

    The temp directory in chart handler configuration is not accessible

    To resolve this, first go to web.config and find the ChartImage directory in appsettings.

    <appSettings>
    <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:TempImageFiles;" />
    </appSettings>

    The go to the temp chart image directory and grant read and write permission to IIS working process account in share properties – security tab. Note that the account runs IIS working process is different between IIS 7 and IIS 7.5

    • On Windows Server 2008 has IIS7, grant Read and Write permission to Network Service
    • On Windows server 2008 R2 has IIS 7.5, grant Read and Write permission to AppPool<PoolName>. Replace <PoolName> to the actual machine pool your site is running on, for example, if your site is running on pool named ASP.NET v4.0, then the account you need grant permission would be IIS AppPoolASP.NET v4.0, you can refer this step by step instructions for detail
  • Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

    You might see following error when browse your application site targeting ASP.NET 4.0 on IIS 7 or 7.5 server.

    HTTP Error 500.21 – Internal Server Error
    Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

    Cause & Solution

    If IIS is enabled after DotNet 4 installation then ASP.NET is not registered with IIS. You will see the error if your site is targeting ASP.NET 4. To resolve this issue, run the following from elevated command line to register ASP.NET 4:

    aspnet_regiis.exe –i

    This will register asp.net with IIS. The aspnet_regiis.exe file can be found in either

    • %windir%Microsoft.NETFrameworkv4.0.30319
    • %windir%Microsoft.NETFramework64v4.0.30319 (on a 64-bit machine)

    More info for ASP.NET IIS Registration Tool (Aspnet_regiis.exe) can be found at http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx

  • Could not load type System.ServiceModel.Activation.HttpModule

    If you install DotNet framework 4.0 on Windows Server 2008 or R2 after enabling IIS,  you might see following error when browse your application site made of ASP.NET 4.0 (or run on ASP.NET 4.0 application pool).

    Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
    Exception Details: System.TypeLoadException: Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.

    Cause & Solution

    If IIS is enabled after DotNet 4 installation then ASP.NET is not registered with IIS. You will see the error if your site is targeting ASP.NET 4. To resolve this issue, run the following from elevated command line to register ASP.NET 4:

    aspnet_regiis.exe /iru

    The aspnet_regiis.exe file can be found in either

    • %windir%Microsoft.NETFrameworkv4.0.30319
    • %windir%Microsoft.NETFramework64v4.0.30319 (on a 64-bit machine)

    More info for ASP.NET IIS Registration Tool (Aspnet_regiis.exe) can be found at http://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx