hosting problem

Topics: General Help
Aug 26, 2010 at 3:49 PM



I'm trying to deploy my website which has the AIP in it, when i try to register a new user (which is where the AIP kicks in)

I get the following error page:

Parser Error

<!-- body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } -->

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'DaveSexton.AutoInputProtection' or one of its dependencies. The module was expected to contain an assembly manifest.

Source Error:

Line 2:  <%@ Page Language="C#" MasterPageFile="~/MasterPage/Master.master" AutoEventWireup="true" CodeFile="RegistrationPage.aspx.cs" Inherits="ContentPages_RegistrationPage" Title="Untitled Page" %>
Line 3:  
Line 4:  <%@ Register Assembly="DaveSexton.AutoInputProtection" Namespace="DaveSexton.Web.Controls"
Line 5:      TagPrefix="dsweb" %>
Line 6:  <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">


my bin directory contains the same 3 files as in my production machine :

also my webconfig file contains the following:
<add verb="GET" path="AIP.ashx"
                 type="DaveSexton.Web.Controls.AutoInputProtectionRequestHandler, DaveSexton.AutoInputProtection" />

so i'm not sure what the problem is, do you have any idea how to fix this?

thanks a lot Nati.

Aug 26, 2010 at 10:54 PM

Hi Nati,

That's the error message for BadImageFormatException.

Make sure your website targets .NET Framework 2.0.  AIP does not support the .NET Framework 4.0 at this time, but thanks for the reminder.

If that's not your problem then try downloading the assembly again, in case it was corrupted somehow.  Also be sure that you're downloading a genuine copy from CodePlex and not from any other web site.

AIP 2.0 Beta

- Dave

Aug 27, 2010 at 3:40 PM

Thanks very much for your reply,it turns out the file was corrupted :) (I have .net 2.0)

however although the page loads, the image  (where the letters which i need to enter are shown)

is not loaded.

this is the line from the html which is relevant

<img id="ctl00_ContentPlaceHolder1_CreateUserWizard1_ctl04_AutoInputProtectionControl1_Image" src="/AIP.ashx?k=nHSAZCy5fJtGrv159Svz3Eyp2mQ%3d" style="height:50px;width:150px;border-width:0px;" />

in my production machine in which it works fine the same line is:

<img id="ctl00_ContentPlaceHolder1_CreateUserWizard1_ctl04_AutoInputProtectionControl1_Image" src="/onwordz%20website%20dployment%20ready/AIP.ashx?k=AUbZ2kodgocY1e1AGSmyfbSa1PY%3d" style="height:50px;width:150px;border-width:0px;" />

so there is a difference in the src value.

once again if you have any suggestion as to what the problem is i'd be most grateful.
thx Nati
Aug 27, 2010 at 5:50 PM
Edited Aug 27, 2010 at 5:53 PM

Hi Nati,

By default, AIP generates a path to the image that is relative to the application's root, using the standard ASP.NET app-relative path notation: 


If your application is nested in IIS, for example, then make sure that IIS is aware by registering it as a virtual application.  This should allow ASP.NET to automatically resolve
the app-relative path, "~".

Alternatively, if for any reason the application root cannot be detected by ASP.NET, or perhaps you're in a strange situation where you need to explicitly specify the AIP image
request handler path, then you can try doing so in your Global.asax file's Application_Start event handler as follows:

protected void Application_Start(Object sender, EventArgs e)
    AutoInputProtection.ImageRequestHandlerPath = "/customPath/AIP.ashx";

Note that AIP.ashx is not actually a real file, it's a virtual handler that is registered in the web.config file; essentially, you would just need to specify the path to the application's root (~)
followed by, "/AIP.ashx".

- Dave