Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Mobile > custom device adapter

Thread Tools

custom device adapter

Posts: n/a
I am unable to get my site to work with a new device
adapter set that I have created. If you call a page on the
site you get the error message:

Server Error in '/' Application.

Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request.
Please review the specific error details below and modify
your configuration file appropriately.

Parser Error Message:
Type 'BangoAdapters.BangoMLPageAdapter' used as
PredicateClass not found.

Source Error:

Line 822: <control
Line 823:
Line 824:
adapter="System.Web.UI.MobileControls.Adapters.Htm lLabelAda
pter" />
Line 825: <control
Line 826:

Source File: c:\winnt\\framework\v1.1.4322
\Config\machine.config Line: 824

Version Information: Microsoft .NET Framework
Version:1.1.4322.573; ASP.NET Version:1.1.4322.573

I created the new device adapter set based upon the
existing wml one. The code for this is in the

.. all the other existing device
adapters ...





Then I have created the predicate class which has just the
predicate method, which determines whether or not this
device adapter should be used, based on some sample code
in an MSPress book. The only difference between this and
the sample code in the book is I had to put 'new' at the
start of the DeviceQualifies property else it would not
build as it said "The keyword new is required
on 'BangoAdapters.BangoMLPageAdapter.DeviceQualifies
(System.Web.HttpContext)' because it hides inherited
member 'System.Web.UI.MobileControls.Adapters.WmlPageAdap te
r.DeviceQualifies(System.Web.HttpContext)'". Alternatively
I also tried calling it DeviceQualifies2 and changed the
predicateMethod in the code above to this method too, but
that didn't work either:

using System;
using System.Web;
using System.Web.Mobile;
using System.Web.UI.MobileControls.Adapters;

namespace BangoAdapters
public class BangoMLPageAdapter : WmlPageAdapter
new public static bool DeviceQualifies
(HttpContext context)
MobileCapabilities capabilities =
bool qualifies =
capabilities.Browser == "Test Browser";
return qualifies;

This should just inherit from the WmlPageAdapter and
because at the moment I haven't over-ridden any of the
properties or methods produce exactly the same output as
the WmlPageAdapter.

The error message seems to be saying it can't find the
predicate class. The suggestion in the book seems to be
that if the assembly containing the predicate class is
referenced in the project then all should be well. However
this seems not to be the case. I'm sure that the assembly
is valid since the intellisense and the drill down in
Visual Studio can both correctly see the class in the
assembly so I'm guessing that the machine.config does not
know about the assembly for some reason.

I tried adding an assembly tag in the machine.config
specifying the name and version of the assembly as follows
but this did not seem to cure the problem. Then I tried
adding the assembly to the Global Assembly Cache to see if
that allowed machine.config to find it but that did not
seem to make any difference either.

assembly="BangoAdapters,Version=1.0.1396.34694,Cul ture=neut
ral,PublicKeyToken=efd73c7058cf2996" />

Can anyone see what the problem is here?
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cisco 1750 Router Cisco QoS Device Manager Cisco VPN Device Manager Rene Kuhn Cisco 0 12-28-2005 08:45 PM
877W - cannot talk wireless device to wireless device Nick Ersdown Cisco 7 10-31-2005 04:20 PM
Will application J2ME MIDP 2.0 based of one device run another J2ME MIDP 2.0 device? nishadixit Java 5 06-01-2005 05:40 AM
Determine the device is a router or switch given the Device IP Cisco 14 12-26-2004 04:11 PM
802.11g router / 1 x 802.11b device / 1 x 802.11g device Oli Wireless Networking 3 09-27-2004 11:56 PM