how to get visual studio to reconize a compiled component

Discussion in 'ASP .Net' started by =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Feb 13, 2005.

  1. thanks much!!!i'm working through an example that creates a component called
    component.dll. This compiled ok w/o problem. I copied it to the bin directory
    of my project (vs.net asp.net vb project) when i attempt to reference it in
    my source it is not found. and when i compile it same thing. how do i get my
    program to reconize this class.
    using code behind.
    here is my source:

    Imports component <--- is not found how do i add it?
    Imports System.Data
    Imports System.Data.SqlClient


    Public Class WebForm1
    Inherits System.Web.UI.Page

    #Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub
    InitializeComponent()

    End Sub
    Protected WithEvents dgrdDatagrid1 As System.Web.UI.WebControls.DataGrid

    'NOTE: The following placeholder declaration is required by the Web Form
    Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Init
    'CODEGEN: This method call is required by the Web Form Designer
    'Do not modify it using the code editor.
    InitializeComponent()
    End Sub

    #End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    'Put user code to initialize the page here
    Dim simplecomponent As New Simple
    Dim dataset As New DataSet
    dataset = simplecomponent.loadDataSet()
    dgrdDatagrid1.DataSource = dataset
    dgrdDatagrid1.DataBind()

    End Sub

    Private Sub dgrdDatagrid1_SelectedIndexChanged(ByVal sender As
    System.Object, ByVal e As System.EventArgs) Handles
    dgrdDatagrid1.SelectedIndexChanged

    End Sub
    End Class
     
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Feb 13, 2005
    #1
    1. Advertising

  2. i think i figured it out, but don't know for sure. I added a reference in
    project/reference. Do ireally need to do this ? i thought it wouold pickup
    automaticly.
    if this is necessary here how about on the production server? do i need to
    add a reference there also?
    thanks
    kes

    "Kurt Schroeder" wrote:

    > thanks much!!!i'm working through an example that creates a component called
    > component.dll. This compiled ok w/o problem. I copied it to the bin directory
    > of my project (vs.net asp.net vb project) when i attempt to reference it in
    > my source it is not found. and when i compile it same thing. how do i get my
    > program to reconize this class.
    > using code behind.
    > here is my source:
    >
    > Imports component <--- is not found how do i add it?
    > Imports System.Data
    > Imports System.Data.SqlClient
    >
    >
    > Public Class WebForm1
    > Inherits System.Web.UI.Page
    >
    > #Region " Web Form Designer Generated Code "
    >
    > 'This call is required by the Web Form Designer.
    > <System.Diagnostics.DebuggerStepThrough()> Private Sub
    > InitializeComponent()
    >
    > End Sub
    > Protected WithEvents dgrdDatagrid1 As System.Web.UI.WebControls.DataGrid
    >
    > 'NOTE: The following placeholder declaration is required by the Web Form
    > Designer.
    > 'Do not delete or move it.
    > Private designerPlaceholderDeclaration As System.Object
    >
    > Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Init
    > 'CODEGEN: This method call is required by the Web Form Designer
    > 'Do not modify it using the code editor.
    > InitializeComponent()
    > End Sub
    >
    > #End Region
    >
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load
    > 'Put user code to initialize the page here
    > Dim simplecomponent As New Simple
    > Dim dataset As New DataSet
    > dataset = simplecomponent.loadDataSet()
    > dgrdDatagrid1.DataSource = dataset
    > dgrdDatagrid1.DataBind()
    >
    > End Sub
    >
    > Private Sub dgrdDatagrid1_SelectedIndexChanged(ByVal sender As
    > System.Object, ByVal e As System.EventArgs) Handles
    > dgrdDatagrid1.SelectedIndexChanged
    >
    > End Sub
    > End Class
    >
     
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Feb 13, 2005
    #2
    1. Advertising

  3. It must be added to the reference, either explicitly in the ASP.NET page or
    in the Web.config file or in the list of references for that project.

    The most easy way to do this, in your case, is first to add the
    component.dll project to the same solution as your asp.net vb project.
    Then, from the References node for the asp.net vb project, you choose from
    the contextual menu (right click of the mouse) Add Reference --> Projects
    (third tab) --> Double click on your component.dll project --> choose
    component.dll at the bottom of the window.

    The component.dll library will be added to the list of references for your
    vb.project, with the property Copy Local set to True and will also be marked
    as a dependency to be compiled first in the list of dependencies for asp.net
    vb project (menu Project --> Project Dependencies --> ...).

    The "Imports component" will not be necessary; it is simply a shortcut for
    importing the namespace "component"; otherwise you have the obligation of
    writing the namespace before your objects:

    Dim simplecomponent As New component.Simple

    instead of:
    Dim simplecomponent As New Simple

    but by itself, it doesn't add any reference to an external library or
    module.

    From there, all the rest will be done automatically by VS.NET; including
    rebuilding/ relinking/ copying the component.dll library when necessary.

    S. L.

    "Kurt Schroeder" <> wrote in message
    news:...
    > thanks much!!!i'm working through an example that creates a component
    > called
    > component.dll. This compiled ok w/o problem. I copied it to the bin
    > directory
    > of my project (vs.net asp.net vb project) when i attempt to reference it
    > in
    > my source it is not found. and when i compile it same thing. how do i get
    > my
    > program to reconize this class.
    > using code behind.
    > here is my source:
    >
    > Imports component <--- is not found how do i add it?
    > Imports System.Data
    > Imports System.Data.SqlClient
    >
    >
    > Public Class WebForm1
    > Inherits System.Web.UI.Page
    >
    > #Region " Web Form Designer Generated Code "
    >
    > 'This call is required by the Web Form Designer.
    > <System.Diagnostics.DebuggerStepThrough()> Private Sub
    > InitializeComponent()
    >
    > End Sub
    > Protected WithEvents dgrdDatagrid1 As
    > System.Web.UI.WebControls.DataGrid
    >
    > 'NOTE: The following placeholder declaration is required by the Web
    > Form
    > Designer.
    > 'Do not delete or move it.
    > Private designerPlaceholderDeclaration As System.Object
    >
    > Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Init
    > 'CODEGEN: This method call is required by the Web Form Designer
    > 'Do not modify it using the code editor.
    > InitializeComponent()
    > End Sub
    >
    > #End Region
    >
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load
    > 'Put user code to initialize the page here
    > Dim simplecomponent As New Simple
    > Dim dataset As New DataSet
    > dataset = simplecomponent.loadDataSet()
    > dgrdDatagrid1.DataSource = dataset
    > dgrdDatagrid1.DataBind()
    >
    > End Sub
    >
    > Private Sub dgrdDatagrid1_SelectedIndexChanged(ByVal sender As
    > System.Object, ByVal e As System.EventArgs) Handles
    > dgrdDatagrid1.SelectedIndexChanged
    >
    > End Sub
    > End Class
    >
     
    Sylvain Lafontaine, Feb 13, 2005
    #3
    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. wh
    Replies:
    2
    Views:
    532
    Cowboy \(Gregory A. Beamer\)
    Jan 16, 2004
  2. Thirumalai
    Replies:
    0
    Views:
    677
    Thirumalai
    May 22, 2006
  3. rockdale
    Replies:
    1
    Views:
    621
    Juan T. Llibre
    Aug 23, 2006
  4. xman
    Replies:
    0
    Views:
    516
  5. xman
    Replies:
    1
    Views:
    616
    Victor Bazarov
    Aug 17, 2005
Loading...

Share This Page