Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to get visual studio to reconize a compiled component

Reply
Thread Tools

how to get visual studio to reconize a compiled component

 
 
=?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
Guest
Posts: n/a
 
      02-13-2005
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
Guest
Posts: n/a
 
      02-13-2005
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
>

 
Reply With Quote
 
 
 
 
Sylvain Lafontaine
Guest
Posts: n/a
 
      02-13-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
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
Is Visual Studio 2005 complict with Visual Studio 2003 rockdale ASP .Net 1 08-23-2006 07:20 PM
Should I write Visual studio 2005 or Visual studio 2003 MCSD =?Utf-8?B?VmlqYXk=?= Microsoft Certification 14 06-30-2006 09:05 AM
Is Visual Studio Team System and Visual Studio Foundation Server are same?. Thirumalai ASP .Net 0 05-22-2006 08:48 AM
visual studio .net 2003 verses visual studio .net 2002 wh ASP .Net 2 01-16-2004 04:54 PM



Advertisments