Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Assemblies question


Message #1 by "Alvin Ling" <alvin.ling@i...> on Wed, 30 Jan 2002 10:28:43 -0500
When creating a custom control, the compiler (VBC since I'm using VB)

requires a /r (references) switch listing several .dll's.  For example:



/r:System.dll,System.Web.dll



My question:  How do I know which dlls/assemblies to reference?  Should

there be a corresponding dll for each Imports statement in my custom

control?





Alvin









Message #2 by "Graham Dobson" <grahamdo@a...> on Wed, 30 Jan 2002 13:55:16 -0500
ASP.NET automatically imports:



    System

    System.Collections

    System.IO

    System.Web

    System.Web.UI

    System.Web.UI.HtmlControls

    System.Web.UI.WebControls



Anything else you would have to import.  If you are using namespaces in your

compiled control then you would have to reference them.  C# Essentials from

O'Rielly has an appendix called Namespaces and Assemblies which matches

Namespaces to DLLs.  Not sure if any of their other books use this appendix

or what VB books would include such a reference, though I'm sure Wrox offers

something similar. Regretably Beginning ASP.NET using C# does not offer a

reference mapping namespaces to DLLs.  Unless I missed something.  Sorry I

don't have any web references  the class viewer utility from the .NET

Framework does list the DLLs as a comment along the top of the selected

class window which tells you what module its in and the name of the DLL.

Not exactly easy to find some of the namespaces though, I know I had trouble

finding System.Data.SqlClient.  The class browser app at

http://www.aspfree.com/quickstart/aspplus/samples/classbrowser/vb/classbrows

er.aspx is a great reference for learning about namespaces but sadly won't

answer your DLL questions.  I also searched through the framework SDK

documentation and couldn't find a table listing the namespace filenames.  It

might be there, and there is some excellent stuff there, but as usual with

these HTML help systems from Microsoft it's not always easy to find

anything.  Hope I was of at least some help....



----- Original Message -----

From: "Alvin Ling" <alvin.ling@i...>

To: "aspx_beginners" <aspx_beginners@p...>

Sent: Wednesday, January 30, 2002 10:28 AM

Subject: [aspx_beginners] Assemblies question





> When creating a custom control, the compiler (VBC since I'm using VB)

> requires a /r (references) switch listing several .dll's.  For example:

>

> /r:System.dll,System.Web.dll

>

> My question:  How do I know which dlls/assemblies to reference?  Should

> there be a corresponding dll for each Imports statement in my custom

> control?

>

>

> Alvin

>

>

>

>

>




$subst('Email.Unsub').

>



Message #3 by "Kyle" <Kyle@T...> on Wed, 30 Jan 2002 14:45:59 -0500
In answer to your question:



> Should there be a corresponding dll for each Imports statement in my

> custom control?



The Imports statement is not required but the assemblies must be

referenced to be accessed.  The Imports statement serves to shorten the

reference in your code to the method in the assembly.  Since I'm a C#

programmer I'll use C# in my sample so I don't get the syntax wrong.



If you use



using System.Data.OleDb;



in your code then you can reference OleDbCommand as



OleDbCommand



If you don't use



using System.Data.OleDb;



in your code then you must give the full reference to OleDbCommand as



System.Data.OleDb.OleDbCommand



If you use



using System;



then you can reference OleDbCommand as



Data.OleDb.OleDbCommand



Replace using with the correct syntax for Imports and I would think that

you get the idea.



Kyle





_____________________________________________



Kyle Dunn

Chief Information Officer

Funeral Services, Inc.

xxx-xxx-xxxx  x 309

Kyle@F...



-----Original Message-----

From: Graham Dobson [mailto:grahamdo@a...]

Sent: Wednesday, January 30, 2002 1:55 PM

To: aspx_beginners

Subject: [aspx_beginners] Re: Assemblies question



ASP.NET automatically imports:



    System

    System.Collections

    System.IO

    System.Web

    System.Web.UI

    System.Web.UI.HtmlControls

    System.Web.UI.WebControls



Anything else you would have to import.  If you are using namespaces in

your

compiled control then you would have to reference them.  C# Essentials

from

O'Rielly has an appendix called Namespaces and Assemblies which matches

Namespaces to DLLs.  Not sure if any of their other books use this

appendix

or what VB books would include such a reference, though I'm sure Wrox

offers

something similar. Regretably Beginning ASP.NET using C# does not offer

a

reference mapping namespaces to DLLs.  Unless I missed something.  Sorry

I

don't have any web references  the class viewer utility from the .NET

Framework does list the DLLs as a comment along the top of the selected

class window which tells you what module its in and the name of the DLL.

Not exactly easy to find some of the namespaces though, I know I had

trouble

finding System.Data.SqlClient.  The class browser app at

http://www.aspfree.com/quickstart/aspplus/samples/classbrowser/vb/classb

rows

er.aspx is a great reference for learning about namespaces but sadly

won't

answer your DLL questions.  I also searched through the framework SDK

documentation and couldn't find a table listing the namespace filenames.

It

might be there, and there is some excellent stuff there, but as usual

with

these HTML help systems from Microsoft it's not always easy to find

anything.  Hope I was of at least some help....



----- Original Message -----

From: "Alvin Ling" <alvin.ling@i...>

To: "aspx_beginners" <aspx_beginners@p...>

Sent: Wednesday, January 30, 2002 10:28 AM

Subject: [aspx_beginners] Assemblies question





> When creating a custom control, the compiler (VBC since I'm using VB)

> requires a /r (references) switch listing several .dll's.  For

example:

>

> /r:System.dll,System.Web.dll

>

> My question:  How do I know which dlls/assemblies to reference?

Should

> there be a corresponding dll for each Imports statement in my custom

> control?

>

>

> Alvin

>

>

>

>

>




$subst('Email.Unsub').

>








$subst('Email.Unsub').


  Return to Index