[Mono-dev] Problem with Request.Browser.MSDomVersion and Firefox

Adar Wesley adar.wesley at gmail.com
Tue Apr 24 14:51:38 EDT 2007


Hi Hubert,

We recently implemented all the missing capabilities in the
HttpBrowserCapablities class.
During the implementation we implemented this throw to be compatible with
MS.Net which
throws if the capability isn't defined at all.  The code is based on the
assumption that the
browscaps.ini file should contain the correct values for all the common
browsers.
However, this is not the case!  Since browscaps.ini has it's own maintainer
we did not update
that file.

In order to fix this problem add the missing definitions to the
browscaps.ini file.
Find the browscaps.ini file next to your machine.config file.  This is the
code that
finds and loads it, from CapabilitiesLoader.cs:
#if TARGET_J2EE
    string filepath = "browscap.ini";
#else
    string dir = HttpRuntime.MachineConfigurationDirectory;
    string filepath = Path.Combine (dir, "browscap.ini");
    if (!File.Exists (filepath)) {
     // try removing the trailing version directory
     dir = Path.GetDirectoryName (dir);
     filepath = Path.Combine (dir, "browscap.ini");
    }
#endif

If you don't know what values to put in the configuration you can find the
values from looking
in Microsoft's definitions in the
C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\Browsers
folder.

I hope this helps.

Adar Wesley
Mainsoft


On 4/24/07, Hubert FONGARNAND <informatique.internet at fiducial.fr> wrote:
>
> try this aspx with firefox
>
> <%@ Page Language="C#" %>
> <Head>
>   <script language=CS runat=server>
>     void Page_Load(object sender, System.EventArgs e)
>     {
>     Console.WriteLine(Request.Browser.W3CDomVersion);
> Console.WriteLine(Request.Browser.MSDomVersion);
>     }
>   </script>
> </Head>
>
> and you'll get
>
> *Argument cannot be null. Parameter name: browscaps.ini does not contain a
> definition for capability msdomversion for userAgent Mozilla*
> *Description: *Error processing request.
>
> *Error Message: *HTTP 500. System.ArgumentNullException: Argument cannot
> be null. Parameter name: browscaps.ini does not contain a definition for
> capability msdomversion for userAgent Mozilla
>
> *Stack Trace: *
>
>   System.ArgumentNullException: Argument cannot be null.
> Parameter name: browscaps.ini does not contain a definition for capability msdomversion for userAgent Mozilla
>   at System.Web.HttpBrowserCapabilities.ReadVersion (System.String key) [0x00000]
>   at System.Web.HttpBrowserCapabilities.get_MSDomVersion () [0x00000]
>   at MetaBuilders.WebControls.ClientScriptUtil.get_RenderUplevel () [0x00000]
>   at MetaBuilders.WebControls.ConfirmedLinkButton.OnPreRender (System.EventArgs e) [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Control.PreRenderRecursiveInternal () [0x00000]
>   at System.Web.UI.Page.InternalProcessRequest () [0x00000]
>   at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000]
>
>
>
> It use to work well with mono 1.2.3
>
> The problem is that we have an external asp.net component using this
> property... This should'nt  crash...
> _______________________________________________
> Ce message et les éventuels documents joints peuvent contenir des
> informations confidentielles.
> Au cas où il ne vous serait pas destiné, nous vous remercions de bien
> vouloir le supprimer et en aviser immédiatement l'expéditeur. Toute
> utilisation de ce message non conforme à sa destination, toute diffusion ou
> publication, totale ou partielle et quel qu'en soit le moyen est
> formellement interdite.
> Les communications sur internet n'étant pas sécurisées, l'intégrité de ce
> message n'est pas assurée et la société émettrice ne peut être tenue pour
> responsable de son contenu.
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>


-- 
---
Adar Wesley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070424/d0bbef74/attachment.html 


More information about the Mono-devel-list mailing list