VS 2002 can't see my Namespace


T

tshad

I have a DLL in the bin folder of my Web Application.

When I try to build it, it says it can't find it.

Here is the beginning of my Class:

*******************************************************
Imports System
Imports System.Data
Imports System.Data.SqlClient

Namespace MyFunctions

' DbObject is the class from which all classes in the Data Services Tier
' inherit. The core functionality of establishing a connection with the
' database and executing simple stored procedures is also provided by
' this base class.
' ---
Public Class DbObject

***********************************************************

This works fine in my other asp.net pages where I don't use use VS to create
it and use:

<%@ Import Namespace="MyFunctions" %>

in my .aspx page.

In my VS Project I just added it to my using section:
using System;
using System.IO;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using integration.RemoteUser;
using integration.PayStatement;
using integration.ReportTable;
using integration.Employee;
using integration.CheckHistory;
using MyFunctions;

Looks the same as the others. What else do I need to do for it to recognize
it?

The error I get is:

The type or namespace name 'MyFunctions' could not be found (are you missing
a using directive or an assembly reference?)

Thanks,

Tom
 
Ad

Advertisements

?

=?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?=

tshad said:
I have a DLL in the bin folder of my Web Application.
<snip>

In order to use classes in a dll you need to add a reference to the dll
itself. Specifying "using Namespace;" is only a shorthand way for the
compiler to find your classes in that dll (ie. you don't have to specify
Namespace.Class).

If you look in the solution window and expand the project you'll have a
"folder" named References. Right-click References and choose Add
Reference, then click Browse and select your dll, then it should work
better.
 
Ad

Advertisements

T

tshad

That did it.

Why don't I have to do that in my .aspx pages?

All I do is:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="MyFunctions" %>

In VS, I can just do this (same as aspx page):
using System.Data;
using System.Data.SqlClient;

why can't I just add the reference:

using MyFunctions;

Isn't that what "Using" is for?

Thanks,

Tom
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top