Error: Option strict disallows late binding

Discussion in 'ASP .Net' started by Adotek, Oct 3, 2006.

  1. Adotek

    Adotek Guest

    Hi All,

    I've just converted a solution from .Net v1.1 to v2.0, by allowing
    Visual Studio 2005 to do the conversion.

    Since doing so, I am getting a compilation error as follows:

    "Option Strict On disallows late binding."

    This references line 1, which is my page directive:

    <%@ Page Language="vb" AutoEventWireup="false" Inherits="perf_man.sbp3"
    Trace="True" CodeFile="sbp3.aspx.vb" %>

    Any ideas?

    Thanks!
    Simon.
    Adotek, Oct 3, 2006
    #1
    1. Advertising

  2. it refers to line one because it cames from sbp3.aspx.vb file and that file
    is in line 1

    so the problem is inside that file

    Late Binding means a lot of things, for example using arrays (like old vb6)

    dim a as array
    a = split( myString, " ")

    if you use

    something = a(0)

    you will get that error, because you are binding the index 0 of the array
    after seting it up, I know it's crazy, but now I understand the concept
    under vb.net 2.0 (after long hours searching for an answer)

    late binding means also like:

    dim myObject

    myObject = new String

    you are binding the myObject as a String after you set it.


    you need to look to your code and see what in the code could be wrong, if
    you use strict on on that .vb file and if you are using Visual Studio 2005
    it will point out the error in Warnings/Errors in the Error List menu (Ctrl
    + E)

    --

    Bruno Alexandre
    København, Danmark

    "a portuguese in Denmark"


    "Adotek" <> escreveu na mensagem
    news:...
    > Hi All,
    >
    > I've just converted a solution from .Net v1.1 to v2.0, by allowing
    > Visual Studio 2005 to do the conversion.
    >
    > Since doing so, I am getting a compilation error as follows:
    >
    > "Option Strict On disallows late binding."
    >
    > This references line 1, which is my page directive:
    >
    > <%@ Page Language="vb" AutoEventWireup="false" Inherits="perf_man.sbp3"
    > Trace="True" CodeFile="sbp3.aspx.vb" %>
    >
    > Any ideas?
    >
    > Thanks!
    > Simon.
    >
    Bruno Alexandre, Oct 3, 2006
    #2
    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. Karl Lang
    Replies:
    1
    Views:
    898
    Karl Lang
    Jun 1, 2004
  2. Ryan McLean

    Option Strict On disallows late binding.

    Ryan McLean, Jun 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    10,338
    mikeb
    Jun 14, 2004
  3. Owen Mortensen
    Replies:
    7
    Views:
    3,149
    Owen Mortensen
    Mar 13, 2006
  4. Chris Davey via .NET 247

    Option Strict On disallows late binding

    Chris Davey via .NET 247, Apr 6, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    162
    Brock Allen
    Apr 6, 2005
  5. Seema
    Replies:
    1
    Views:
    849
    Arne Vajhøj
    Jan 25, 2012
Loading...

Share This Page