Object of type 'System.String' cannot be converted to type 'System

Discussion in 'ASP .Net Building Controls' started by Robert, Nov 18, 2005.

  1. Robert

    Robert Guest

    I'm trying to get a control from metabuilders.com dual list)to work under
    ASP.NET 2.0. It worked find under 1.1 and then when i migrated my
    application to 2.0 I ran into problems with it.

    However, I'm getting an error on a particular line as follows:

    Exception: System.Web.HttpUnhandledException: Exception of type
    'System.Web.HttpUnhandledException' was thrown. --->
    System.ArgumentException: Object of type 'System.String' cannot be converted
    to type 'System.Web.VirtualPath'.
    at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo
    culture, BindingFlags invokeAttr)
    at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder
    binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
    invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean
    skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
    invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at MetaBuilders.WebControls.DynamicListBoxResourceHandler.DetermineIsRegistere
    d()
    at MetaBuilders.WebControls.DynamicListBoxResourceHandler.get_IsRegistered()
    at
    MetaBuilders.WebControls.DynamicListBoxResourceHandler.RegisterScript(Page
    page, String scriptKey, String scriptFile)
    at MetaBuilders.WebControls.DualList.RegisterScriptLibrary()
    at MetaBuilders.WebControls.DualList.RegisterScript()
    at MetaBuilders.WebControls.DualList.OnPreRender(EventArgs e)
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


    The function where the error occurs is below and the line causing the error
    reads "Object handler = findMapping.Invoke..."

    I'm a bit lost because I'm having trouble understanding exactly what this
    function does and why all of sudden it does not work under 2.0 but works fine
    under 1.1.

    Any ideas or suggestions? I'm also at the point of throwning the thing
    completely out and creating my own. The metabuilders site seems to be
    basically dead for the past year so I'm out of luck getting help there.

    private static Boolean DetermineIsRegistered() {
    Object handlerMap =
    System.Web.HttpContext.GetAppConfig("system.web/httpHandlers");
    if ( handlerMap == null ) {
    return false;
    }

    MethodInfo findMapping = handlerMap.GetType().GetMethod("FindMapping",
    BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic );
    if ( findMapping == null ) {
    return false;
    }

    Object handler = findMapping.Invoke(handlerMap, new Object[] { "GET",
    handlerName } );
    if ( handler == null ) {
    return false;
    }

    PropertyInfo handlerPathProperty = handler.GetType().GetProperty("Path",
    BindingFlags.NonPublic | BindingFlags.Instance );
    if ( handlerPathProperty == null ) {
    return false;
    }

    String handlerPath = handlerPathProperty.GetValue(handler,null) as String;
    if ( handlerPath == null || handlerPath != handlerName ) {
    return false;
    }

    return true;
    }
    Robert, Nov 18, 2005
    #1
    1. Advertising

  2. Hi,

    We have reviewed this issue and are currently researching on it. We will
    update you ASAP. Thanks for your patience!

    Kevin Yu
    =======
    "This posting is provided "AS IS" with no warranties, and confers no
    rights."
    Kevin Yu [MSFT], Nov 19, 2005
    #2
    1. Advertising

  3. Hello Robert,

    Welcome to ASPNET newsgroup.
    From your description, you're using a certain 3rd party webcontrol in your
    asp.net applicaiton, it works well in ASP.NET 1.1 and after upgrate to the
    asp.net 2.0 ,it no longer work and throw some parameter converting error ,
    yes?

    Based on the exception message and call stack you provided, seems that
    webcontrol is using the HttpContext.GetAppConfig method to retrieve
    web.config's configuration info in your certain web control. And based on
    my research the HttpContext.GetAppConfig method return an object instance
    (of a internal class type), so this method is not designed for external
    use(mainly used by asp.net runtime internally), also in asp.net 2.0 this
    method has been marked as obsolete. So the problem must be caused by some
    internal implementation of the method and its return type has been changed.
    And from MSDN documenation , we can find that in ASP.NET 2.0, we're
    suggested to use the
    System.Web.Configuration.WebConfigurationManager.GetWebApplicationSection
    instead of the HttpContext.GetAppConfig since the .net framework 2.0 has
    provided much more powerful interfaces to retrieve application
    configuration data......

    So as for your scenario, the webcontrol is developed by 3rd party, I'm
    afraid we have to contact the 3rd party to see whether they've provided new
    version which has used the new interfaces which can work correctly in
    ASP.NET 2.0.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)



    --------------------
    | Thread-Topic: Object of type 'System.String' cannot be converted to type
    'System
    | thread-index: AcXsieY8VZqgYbrQTKSV+fK7fieRiQ==
    | X-WBNR-Posting-Host: 67.180.214.235
    | From: =?Utf-8?B?Um9iZXJ0?= <>
    | Subject: Object of type 'System.String' cannot be converted to type
    'System
    | Date: Fri, 18 Nov 2005 13:49:06 -0800
    | Lines: 78
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet.buildingcontrols:14007
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    |
    | I'm trying to get a control from metabuilders.com dual list)to work under
    | ASP.NET 2.0. It worked find under 1.1 and then when i migrated my
    | application to 2.0 I ran into problems with it.
    |
    | However, I'm getting an error on a particular line as follows:
    |
    | Exception: System.Web.HttpUnhandledException: Exception of type
    | 'System.Web.HttpUnhandledException' was thrown. --->
    | System.ArgumentException: Object of type 'System.String' cannot be
    converted
    | to type 'System.Web.VirtualPath'.
    | at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo
    | culture, BindingFlags invokeAttr)
    | at System.Reflection.MethodBase.CheckArguments(Object[] parameters,
    Binder
    | binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
    | at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
    | invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
    Boolean
    | skipVisibilityChecks)
    | at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
    | invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    | at
    MetaBuilders.WebControls.DynamicListBoxResourceHandler.DetermineIsRegistere
    | d()
    | at
    MetaBuilders.WebControls.DynamicListBoxResourceHandler.get_IsRegistered()
    | at
    |
    MetaBuilders.WebControls.DynamicListBoxResourceHandler.RegisterScript(Page
    | page, String scriptKey, String scriptFile)
    | at MetaBuilders.WebControls.DualList.RegisterScriptLibrary()
    | at MetaBuilders.WebControls.DualList.RegisterScript()
    | at MetaBuilders.WebControls.DualList.OnPreRender(EventArgs e)
    | at System.Web.UI.Control.PreRenderRecursiveInternal()
    | at System.Web.UI.Control.PreRenderRecursiveInternal()
    | at System.Web.UI.Control.PreRenderRecursiveInternal()
    | at System.Web.UI.Page.ProcessRequestMain(Boolean
    | includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    |
    |
    | The function where the error occurs is below and the line causing the
    error
    | reads "Object handler = findMapping.Invoke..."
    |
    | I'm a bit lost because I'm having trouble understanding exactly what this
    | function does and why all of sudden it does not work under 2.0 but works
    fine
    | under 1.1.
    |
    | Any ideas or suggestions? I'm also at the point of throwning the thing
    | completely out and creating my own. The metabuilders site seems to be
    | basically dead for the past year so I'm out of luck getting help there.
    |
    | private static Boolean DetermineIsRegistered() {
    | Object handlerMap =
    | System.Web.HttpContext.GetAppConfig("system.web/httpHandlers");
    | if ( handlerMap == null ) {
    | return false;
    | }
    |
    | MethodInfo findMapping = handlerMap.GetType().GetMethod("FindMapping",
    | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic );
    | if ( findMapping == null ) {
    | return false;
    | }
    |
    | Object handler = findMapping.Invoke(handlerMap, new Object[] { "GET",
    | handlerName } );
    | if ( handler == null ) {
    | return false;
    | }
    |
    | PropertyInfo handlerPathProperty =
    handler.GetType().GetProperty("Path",
    | BindingFlags.NonPublic | BindingFlags.Instance );
    | if ( handlerPathProperty == null ) {
    | return false;
    | }
    |
    | String handlerPath = handlerPathProperty.GetValue(handler,null) as
    String;
    | if ( handlerPath == null || handlerPath != handlerName ) {
    | return false;
    | }
    |
    | return true;
    | }
    |
    Steven Cheng[MSFT], Nov 19, 2005
    #3
  4. Robert

    Robert Guest

    RE: Object of type 'System.String' cannot be converted to type 'Sy

    Thanks for your response. I have sent to them and will see if i get a
    response back. Otherwise I'll just roll my own control from scratch since
    there's is a bit overly heavy for what I am using it for and it will be
    easier to build a simpler one to meet my needs from scratch then try to
    figure out the purpose of the section that is causing an issue.

    If i get a response back, I'll post how to fix the problem in the event
    someone else is interested down the road.

    Thanks for the speedy response.

    "Steven Cheng[MSFT]" wrote:

    > Hello Robert,
    >
    > Welcome to ASPNET newsgroup.
    > From your description, you're using a certain 3rd party webcontrol in your
    > asp.net applicaiton, it works well in ASP.NET 1.1 and after upgrate to the
    > asp.net 2.0 ,it no longer work and throw some parameter converting error ,
    > yes?
    >
    > Based on the exception message and call stack you provided, seems that
    > webcontrol is using the HttpContext.GetAppConfig method to retrieve
    > web.config's configuration info in your certain web control. And based on
    > my research the HttpContext.GetAppConfig method return an object instance
    > (of a internal class type), so this method is not designed for external
    > use(mainly used by asp.net runtime internally), also in asp.net 2.0 this
    > method has been marked as obsolete. So the problem must be caused by some
    > internal implementation of the method and its return type has been changed.
    > And from MSDN documenation , we can find that in ASP.NET 2.0, we're
    > suggested to use the
    > System.Web.Configuration.WebConfigurationManager.GetWebApplicationSection
    > instead of the HttpContext.GetAppConfig since the .net framework 2.0 has
    > provided much more powerful interfaces to retrieve application
    > configuration data......
    >
    > So as for your scenario, the webcontrol is developed by 3rd party, I'm
    > afraid we have to contact the 3rd party to see whether they've provided new
    > version which has used the new interfaces which can work correctly in
    > ASP.NET 2.0.
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    >
    > --------------------
    > | Thread-Topic: Object of type 'System.String' cannot be converted to type
    > 'System
    > | thread-index: AcXsieY8VZqgYbrQTKSV+fK7fieRiQ==
    > | X-WBNR-Posting-Host: 67.180.214.235
    > | From: =?Utf-8?B?Um9iZXJ0?= <>
    > | Subject: Object of type 'System.String' cannot be converted to type
    > 'System
    > | Date: Fri, 18 Nov 2005 13:49:06 -0800
    > | Lines: 78
    > | Message-ID: <>
    > | MIME-Version: 1.0
    > | Content-Type: text/plain;
    > | charset="Utf-8"
    > | Content-Transfer-Encoding: 7bit
    > | X-Newsreader: Microsoft CDO for Windows 2000
    > | Content-Class: urn:content-classes:message
    > | Importance: normal
    > | Priority: normal
    > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    > | Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    > | Xref: TK2MSFTNGXA02.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.buildingcontrols:14007
    > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    > |
    > | I'm trying to get a control from metabuilders.com dual list)to work under
    > | ASP.NET 2.0. It worked find under 1.1 and then when i migrated my
    > | application to 2.0 I ran into problems with it.
    > |
    > | However, I'm getting an error on a particular line as follows:
    > |
    > | Exception: System.Web.HttpUnhandledException: Exception of type
    > | 'System.Web.HttpUnhandledException' was thrown. --->
    > | System.ArgumentException: Object of type 'System.String' cannot be
    > converted
    > | to type 'System.Web.VirtualPath'.
    > | at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo
    > | culture, BindingFlags invokeAttr)
    > | at System.Reflection.MethodBase.CheckArguments(Object[] parameters,
    > Binder
    > | binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
    > | at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
    > | invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
    > Boolean
    > | skipVisibilityChecks)
    > | at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
    > | invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    > | at
    > MetaBuilders.WebControls.DynamicListBoxResourceHandler.DetermineIsRegistere
    > | d()
    > | at
    > MetaBuilders.WebControls.DynamicListBoxResourceHandler.get_IsRegistered()
    > | at
    > |
    > MetaBuilders.WebControls.DynamicListBoxResourceHandler.RegisterScript(Page
    > | page, String scriptKey, String scriptFile)
    > | at MetaBuilders.WebControls.DualList.RegisterScriptLibrary()
    > | at MetaBuilders.WebControls.DualList.RegisterScript()
    > | at MetaBuilders.WebControls.DualList.OnPreRender(EventArgs e)
    > | at System.Web.UI.Control.PreRenderRecursiveInternal()
    > | at System.Web.UI.Control.PreRenderRecursiveInternal()
    > | at System.Web.UI.Control.PreRenderRecursiveInternal()
    > | at System.Web.UI.Page.ProcessRequestMain(Boolean
    > | includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    > |
    > |
    > | The function where the error occurs is below and the line causing the
    > error
    > | reads "Object handler = findMapping.Invoke..."
    > |
    > | I'm a bit lost because I'm having trouble understanding exactly what this
    > | function does and why all of sudden it does not work under 2.0 but works
    > fine
    > | under 1.1.
    > |
    > | Any ideas or suggestions? I'm also at the point of throwning the thing
    > | completely out and creating my own. The metabuilders site seems to be
    > | basically dead for the past year so I'm out of luck getting help there.
    > |
    > | private static Boolean DetermineIsRegistered() {
    > | Object handlerMap =
    > | System.Web.HttpContext.GetAppConfig("system.web/httpHandlers");
    > | if ( handlerMap == null ) {
    > | return false;
    > | }
    > |
    > | MethodInfo findMapping = handlerMap.GetType().GetMethod("FindMapping",
    > | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic );
    > | if ( findMapping == null ) {
    > | return false;
    > | }
    > |
    > | Object handler = findMapping.Invoke(handlerMap, new Object[] { "GET",
    > | handlerName } );
    > | if ( handler == null ) {
    > | return false;
    > | }
    > |
    > | PropertyInfo handlerPathProperty =
    > handler.GetType().GetProperty("Path",
    > | BindingFlags.NonPublic | BindingFlags.Instance );
    > | if ( handlerPathProperty == null ) {
    > | return false;
    > | }
    > |
    > | String handlerPath = handlerPathProperty.GetValue(handler,null) as
    > String;
    > | if ( handlerPath == null || handlerPath != handlerName ) {
    > | return false;
    > | }
    > |
    > | return true;
    > | }
    > |
    >
    >
    Robert, Nov 19, 2005
    #4
  5. RE: Object of type 'System.String' cannot be converted to type 'Sy

    Thanks for your response Robert,

    Yes, if it's not very complex to construct a new custom webcontrol to
    replace that 3rd party one, that'll be the quickest and most convenience
    approach since we can utilize the new ASP.NET 2.0 configuration model.
    Anyway, please feel free to post here when you got any progress or need any
    further assistance.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | Thread-Topic: Object of type 'System.String' cannot be converted to type
    'Sy
    | thread-index: AcXtTcCZu2zXsbeBSoGWufO+10asTw==
    | X-WBNR-Posting-Host: 67.180.214.235
    | From: =?Utf-8?B?Um9iZXJ0?= <>
    | References: <>
    <>
    | Subject: RE: Object of type 'System.String' cannot be converted to type
    'Sy
    | Date: Sat, 19 Nov 2005 13:11:04 -0800
    | Lines: 170
    | Message-ID: <>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="Utf-8"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | Content-Class: urn:content-classes:message
    | Importance: normal
    | Priority: normal
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet.buildingcontrols:14018
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    |
    | Thanks for your response. I have sent to them and will see if i get a
    | response back. Otherwise I'll just roll my own control from scratch
    since
    | there's is a bit overly heavy for what I am using it for and it will be
    | easier to build a simpler one to meet my needs from scratch then try to
    | figure out the purpose of the section that is causing an issue.
    |
    | If i get a response back, I'll post how to fix the problem in the event
    | someone else is interested down the road.
    |
    | Thanks for the speedy response.
    |
    | "Steven Cheng[MSFT]" wrote:
    |
    | > Hello Robert,
    | >
    | > Welcome to ASPNET newsgroup.
    | > From your description, you're using a certain 3rd party webcontrol in
    your
    | > asp.net applicaiton, it works well in ASP.NET 1.1 and after upgrate to
    the
    | > asp.net 2.0 ,it no longer work and throw some parameter converting
    error ,
    | > yes?
    | >
    | > Based on the exception message and call stack you provided, seems that
    | > webcontrol is using the HttpContext.GetAppConfig method to retrieve
    | > web.config's configuration info in your certain web control. And based
    on
    | > my research the HttpContext.GetAppConfig method return an object
    instance
    | > (of a internal class type), so this method is not designed for external
    | > use(mainly used by asp.net runtime internally), also in asp.net 2.0
    this
    | > method has been marked as obsolete. So the problem must be caused by
    some
    | > internal implementation of the method and its return type has been
    changed.
    | > And from MSDN documenation , we can find that in ASP.NET 2.0, we're
    | > suggested to use the
    | >
    System.Web.Configuration.WebConfigurationManager.GetWebApplicationSection
    | > instead of the HttpContext.GetAppConfig since the .net framework 2.0
    has
    | > provided much more powerful interfaces to retrieve application
    | > configuration data......
    | >
    | > So as for your scenario, the webcontrol is developed by 3rd party, I'm
    | > afraid we have to contact the 3rd party to see whether they've provided
    new
    | > version which has used the new interfaces which can work correctly in
    | > ASP.NET 2.0.
    | >
    | > Thanks,
    | >
    | > Steven Cheng
    | > Microsoft Online Support
    | >
    | > Get Secure! www.microsoft.com/security
    | > (This posting is provided "AS IS", with no warranties, and confers no
    | > rights.)
    | >
    | >
    | >
    | > --------------------
    | > | Thread-Topic: Object of type 'System.String' cannot be converted to
    type
    | > 'System
    | > | thread-index: AcXsieY8VZqgYbrQTKSV+fK7fieRiQ==
    | > | X-WBNR-Posting-Host: 67.180.214.235
    | > | From: =?Utf-8?B?Um9iZXJ0?= <>
    | > | Subject: Object of type 'System.String' cannot be converted to type
    | > 'System
    | > | Date: Fri, 18 Nov 2005 13:49:06 -0800
    | > | Lines: 78
    | > | Message-ID: <>
    | > | MIME-Version: 1.0
    | > | Content-Type: text/plain;
    | > | charset="Utf-8"
    | > | Content-Transfer-Encoding: 7bit
    | > | X-Newsreader: Microsoft CDO for Windows 2000
    | > | Content-Class: urn:content-classes:message
    | > | Importance: normal
    | > | Priority: normal
    | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
    | > | Path:
    TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
    | > | Xref: TK2MSFTNGXA02.phx.gbl
    | > microsoft.public.dotnet.framework.aspnet.buildingcontrols:14007
    | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.buildingcontrols
    | > |
    | > | I'm trying to get a control from metabuilders.com dual list)to work
    under
    | > | ASP.NET 2.0. It worked find under 1.1 and then when i migrated my
    | > | application to 2.0 I ran into problems with it.
    | > |
    | > | However, I'm getting an error on a particular line as follows:
    | > |
    | > | Exception: System.Web.HttpUnhandledException: Exception of type
    | > | 'System.Web.HttpUnhandledException' was thrown. --->
    | > | System.ArgumentException: Object of type 'System.String' cannot be
    | > converted
    | > | to type 'System.Web.VirtualPath'.
    | > | at System.RuntimeType.CheckValue(Object value, Binder binder,
    CultureInfo
    | > | culture, BindingFlags invokeAttr)
    | > | at System.Reflection.MethodBase.CheckArguments(Object[] parameters,
    | > Binder
    | > | binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
    | > | at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
    BindingFlags
    | > | invokeAttr, Binder binder, Object[] parameters, CultureInfo culture,
    | > Boolean
    | > | skipVisibilityChecks)
    | > | at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
    BindingFlags
    | > | invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    | > | at
    | >
    MetaBuilders.WebControls.DynamicListBoxResourceHandler.DetermineIsRegistere
    | > | d()
    | > | at
    | >
    MetaBuilders.WebControls.DynamicListBoxResourceHandler.get_IsRegistered()
    | > | at
    | > |
    | >
    MetaBuilders.WebControls.DynamicListBoxResourceHandler.RegisterScript(Page
    | > | page, String scriptKey, String scriptFile)
    | > | at MetaBuilders.WebControls.DualList.RegisterScriptLibrary()
    | > | at MetaBuilders.WebControls.DualList.RegisterScript()
    | > | at MetaBuilders.WebControls.DualList.OnPreRender(EventArgs e)
    | > | at System.Web.UI.Control.PreRenderRecursiveInternal()
    | > | at System.Web.UI.Control.PreRenderRecursiveInternal()
    | > | at System.Web.UI.Control.PreRenderRecursiveInternal()
    | > | at System.Web.UI.Page.ProcessRequestMain(Boolean
    | > | includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    | > |
    | > |
    | > | The function where the error occurs is below and the line causing the
    | > error
    | > | reads "Object handler = findMapping.Invoke..."
    | > |
    | > | I'm a bit lost because I'm having trouble understanding exactly what
    this
    | > | function does and why all of sudden it does not work under 2.0 but
    works
    | > fine
    | > | under 1.1.
    | > |
    | > | Any ideas or suggestions? I'm also at the point of throwning the
    thing
    | > | completely out and creating my own. The metabuilders site seems to
    be
    | > | basically dead for the past year so I'm out of luck getting help
    there.
    | > |
    | > | private static Boolean DetermineIsRegistered() {
    | > | Object handlerMap =
    | > | System.Web.HttpContext.GetAppConfig("system.web/httpHandlers");
    | > | if ( handlerMap == null ) {
    | > | return false;
    | > | }
    | > |
    | > | MethodInfo findMapping =
    handlerMap.GetType().GetMethod("FindMapping",
    | > | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic
    );
    | > | if ( findMapping == null ) {
    | > | return false;
    | > | }
    | > |
    | > | Object handler = findMapping.Invoke(handlerMap, new Object[] {
    "GET",
    | > | handlerName } );
    | > | if ( handler == null ) {
    | > | return false;
    | > | }
    | > |
    | > | PropertyInfo handlerPathProperty =
    | > handler.GetType().GetProperty("Path",
    | > | BindingFlags.NonPublic | BindingFlags.Instance );
    | > | if ( handlerPathProperty == null ) {
    | > | return false;
    | > | }
    | > |
    | > | String handlerPath = handlerPathProperty.GetValue(handler,null) as
    | > String;
    | > | if ( handlerPath == null || handlerPath != handlerName ) {
    | > | return false;
    | > | }
    | > |
    | > | return true;
    | > | }
    | > |
    | >
    | >
    |
    Steven Cheng[MSFT], Nov 20, 2005
    #5
  6. Robert

    阿利 Guest

    alcsharp 寫é“:

    > Hi Robert,
    > I just came across your post as I was looking for a solution for the
    > same exact issue using metabuilder's DualList in .Net 2.0. I know it's
    > a bit late since you posted this months ago but I have a solution to it
    > that seems to be working. Let me know if you're still interested and
    > I'll post the changes to sourcecode provided with the control that got
    > it working for me (was only 2 lines that had to change).
    > Thanks,
    > Alex


    yea ~ I'd like to know , please send me a copy :D

    Miz
    阿利, Apr 20, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2Vhbg==?=
    Replies:
    2
    Views:
    8,956
    Kevin Spencer
    Feb 6, 2004
  2. Mike Schnorr
    Replies:
    0
    Views:
    1,617
    Mike Schnorr
    Jun 25, 2004
  3. Chun
    Replies:
    0
    Views:
    711
  4. Bert Leu
    Replies:
    1
    Views:
    473
    Laurent Bugnion, MVP
    Jun 9, 2007
  5. Bert Leu

    value of type "xxx" cannot be converted to "xxx"

    Bert Leu, Jun 5, 2007, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    287
    Jesse Houwing
    Jun 6, 2007
Loading...

Share This Page