473,378 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Namespace cannot be found? Help!

I'm trying to use a namespace i've created but i keep
getting a compile error at runtime. Here's the files and
problem i'm having. Any ideas?

index.aspx // file with html, etc
index_CB.cs // contains the code behind from index.aspx
testcomponents.cs // contains the namespace i'm trying to
use..

Everything COMPILES just file when I compile from the
command line, however, when I RUN the app (when I open
index.aspx in my brower) I get a 'compilation error:
namespace NSTestComponents cannot be found, (are you
missing a using directive or an assembly reference?)'

Here are the files (followed by the command i'm using to
compile)

CONTENTS FOR testcomponents.cs

using System;

namespace NSTestComponents

{

public class CTestClass

{

public void SomeFunction ()

{

}

}

}

NOW, CONTENTS for index.aspx

<%@ Page Language="C#"

Inherits="CMyCodeBehind"

Src="index_CB.cs"

ContentType="text/html"

ResponseEncoding="iso-8859-1"

ValidateRequest="false"

Debug="true"

%>

<%@ Import Namespace="NSTestComponents" %>

....

AND FINALLY FOR index_CB.cs

using System;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Collections;

using System.Data;

using System.Data.Odbc;

using NSTestComponents; // THIS LINE GIVES ME THE
COMPILATION ERROR WHEN I OPEN THE .ASPX FILE IN MY
BROWSER...

public class CMyCodeBehind : Page

{...


and here is the command line i'm using:
csc /target:library /out:testcomponents.dll
testcomponents.cs (and i've copied the .dll to my /bin
directory)

i'm GUESSING i need to edit the command line i just have
no idea how... my books are telling me this one should
work just fine, but that 'references' need to be added to
it when using webcontrols or htmlcontrols in the
component.. it just doesn't say which ones or even how..
so, i'm stumped...
Nov 18 '05 #1
0 1033

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Kai-Uwe Bux | last post by:
Hi folks, I observed something that puzzles me. When I do namespace xxx { using std::swap; } it appears that xxx::swap and std::swap are not strictly equivalent. In particular, I think...
4
by: BH | last post by:
Hi C# & .NET detectives, can you help with two problems I've encountered lately? 1) These seem equivalent to me but one fails and the other doesn't. This fails with "type or namespace...
5
by: Sting | last post by:
I had a working .net program I've re-installed XP (defective harddisk). and now i keep getting BC30466: Namespace or type 'test' for the Imports 'test' cannot be found. The assembly is called...
4
by: Stephen Cochran | last post by:
I'm getting the following error in my ASP.NET application: Namespace or type 'DirectoryServices' for the Imports 'System.DirectoryServices' cannot be found. I have added the...
1
by: sorCrer | last post by:
Hi All, I have searched for this problem but unusually have had no luck! I have an .vb file in the code directory with the following simplified code in it: Namespace MyTest Public Class...
29
by: Tiraman | last post by:
Hi, I Build my own dll with my own namespace name and i would like to put it in one place but for the project bin folder so all of the projects will be able to use it . i tried to put the dll...
1
by: Michael | last post by:
Please help. I have the following imports in my class file: Imports System.Windows.Forms Imports System.Drawing But I get the following error message when I hover the mouse over the above....
3
by: sjt003 | last post by:
I have been developing web apps in Visual Studio 2003, but since the other developers in my office don't use Visual Studio, I may have to stop too unless there is an efficient way for them to...
2
by: Andrus | last post by:
I'm trying to compile myGeneration PropertyCollectionAll.cs file with VCS Express 2005 bot got error Error 1 The type or namespace name 'Collection' could not be found (are you missing a using...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.