Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

custom device adapter

 
 
steph
Guest
Posts: n/a
 
      10-30-2003
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:
name="System.Web.UI.MobileControls.Label"
Line 824:
adapter="System.Web.UI.MobileControls.Adapters.Htm lLabelAda
pter" />
Line 825: <control
Line 826:
name="System.Web.UI.MobileControls.LiteralText"


Source File: c:\winnt\microsoft.net\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
machine.config:

.. all the other existing device
adapters ...

<device
name="BangoMLDeviceAdapters"
inheritsFrom="WmlDeviceAdapters"

predicateClass="BangoAdapters.BangoMLPageAdapter"
predicateMethod="DeviceQualifies"

pageAdapter="BangoAdapters.BangoMLPageAdapter">
</device>

</mobileControls>



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 =
((MobileCapabilities)context.Request.Browser);
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.

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

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

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 kiranreddyd@gmail.com 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



Advertisments