473,386 Members | 1,795 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,386 software developers and data experts.

namespace name could not be found

I have a simple project that builds ok in Visual Web Developer, but
which fails when I navigate to it at //localhost. The error is
"namespace 'ac' could not be found".

the problem page is at
inetpub/wwwroot/DemoSite/Page1.aspx

which I navigate to at
//localhost/DemoSite/Page1.aspx

I manually created a /bin directory within the /DemoSite directory:
c:/inetpub/wwwroot/DemoSite/bin

So DemoSite is my application root directory and /bin is my ~/bin
directory? Is that correct?

I built a class library "ac" using the C# compiler and copied ac.dll to
the ~/bin directory.

Visual Web Developer liked this arrangement because I was able to
successfully build a single page web site that referenced a static
method in the "ac" namespace.
c://inetpub/wwwroot/DemoSite/Page1.aspx

However, when I navigate to my website page at
//localhost/DemoSite/Page1.aspx
two odd things happen:
- IIS compiles the page again. But I had built the website thru
Visual Web Developer. Why is IIS compiling it again?
- the IIS build fails because namespace "ac" is not found. Why does
the IIS build not find the namespace in /DemoSite/Bin/ac.dll just like
VWD2005 does?

Source code and error messages follow.

-Steve

<%@ Page Language="C#" Trace=true %>
<%@ Import Namespace="ac" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<script runat="server">

void Page_Load(object sender, EventArgs e)
{
Trace.Write("AutoCoder", ac.Common.GetConnectionString());
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>

-------------------------------------------------------------
Compiler Error Message: CS0246: The type or namespace name 'ac' could
not be found (are you missing a using directive or an assembly
reference?)

Source Error:
Line 1: <%@ Page Language="C#" Trace=true %>
Line 2: <%@ Import Namespace="ac" %>
Line 3:
Line 4: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Source File: c:\Inetpub\wwwroot\DemoSite\Page1.aspx Line: 2

Nov 19 '05 #1
2 2036
DemoSite is only an application root if you made it an application root in
the IIS management console. If not, then wwwroot is still the application
root and DemoSite is just a normal directory. Chances are this is what is
happening. Try moving the bin directory up to the wwwroot directory and see
what happens. To create the directory as an application in the IIS MMC
right-click the directory name and select properties. On the directory tab,
under application settings click the create button to begin the process that
designates it as an application.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

"Steve Richter" <St************@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
I have a simple project that builds ok in Visual Web Developer, but
which fails when I navigate to it at //localhost. The error is
"namespace 'ac' could not be found".

the problem page is at
inetpub/wwwroot/DemoSite/Page1.aspx

which I navigate to at
//localhost/DemoSite/Page1.aspx

I manually created a /bin directory within the /DemoSite directory:
c:/inetpub/wwwroot/DemoSite/bin

So DemoSite is my application root directory and /bin is my ~/bin
directory? Is that correct?

I built a class library "ac" using the C# compiler and copied ac.dll to
the ~/bin directory.

Visual Web Developer liked this arrangement because I was able to
successfully build a single page web site that referenced a static
method in the "ac" namespace.
c://inetpub/wwwroot/DemoSite/Page1.aspx

However, when I navigate to my website page at
//localhost/DemoSite/Page1.aspx
two odd things happen:
- IIS compiles the page again. But I had built the website thru
Visual Web Developer. Why is IIS compiling it again?
- the IIS build fails because namespace "ac" is not found. Why does
the IIS build not find the namespace in /DemoSite/Bin/ac.dll just like
VWD2005 does?

Source code and error messages follow.

-Steve

<%@ Page Language="C#" Trace=true %>
<%@ Import Namespace="ac" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<script runat="server">

void Page_Load(object sender, EventArgs e)
{
Trace.Write("AutoCoder", ac.Common.GetConnectionString());
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>

-------------------------------------------------------------
Compiler Error Message: CS0246: The type or namespace name 'ac' could
not be found (are you missing a using directive or an assembly
reference?)

Source Error:
Line 1: <%@ Page Language="C#" Trace=true %>
Line 2: <%@ Import Namespace="ac" %>
Line 3:
Line 4: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Source File: c:\Inetpub\wwwroot\DemoSite\Page1.aspx Line: 2

Nov 19 '05 #2

Mark Fitzpatrick wrote:
DemoSite is only an application root if you made it an application root in the IIS management console. If not, then wwwroot is still the application root and DemoSite is just a normal directory. Chances are this is what is happening. Try moving the bin directory up to the wwwroot directory and see what happens. To create the directory as an application in the IIS MMC right-click the directory name and select properties. On the directory tab, under application settings click the create button to begin the process that designates it as an application.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
that did it, Mark. One click - done!

thanks,

-Steve

"Steve Richter" <St************@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
I have a simple project that builds ok in Visual Web Developer, but
which fails when I navigate to it at //localhost. The error is
"namespace 'ac' could not be found".

the problem page is at
inetpub/wwwroot/DemoSite/Page1.aspx

which I navigate to at
//localhost/DemoSite/Page1.aspx

I manually created a /bin directory within the /DemoSite directory:
c:/inetpub/wwwroot/DemoSite/bin

So DemoSite is my application root directory and /bin is my ~/bin
directory? Is that correct?

I built a class library "ac" using the C# compiler and copied ac.dll to the ~/bin directory.

Visual Web Developer liked this arrangement because I was able to
successfully build a single page web site that referenced a static
method in the "ac" namespace.
c://inetpub/wwwroot/DemoSite/Page1.aspx

However, when I navigate to my website page at
//localhost/DemoSite/Page1.aspx
two odd things happen:
- IIS compiles the page again. But I had built the website thru
Visual Web Developer. Why is IIS compiling it again?
- the IIS build fails because namespace "ac" is not found. Why does the IIS build not find the namespace in /DemoSite/Bin/ac.dll just like VWD2005 does?

Source code and error messages follow.

-Steve

<%@ Page Language="C#" Trace=true %>
<%@ Import Namespace="ac" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<script runat="server">

void Page_Load(object sender, EventArgs e)
{
Trace.Write("AutoCoder", ac.Common.GetConnectionString());
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>

-------------------------------------------------------------
Compiler Error Message: CS0246: The type or namespace name 'ac' could not be found (are you missing a using directive or an assembly
reference?)

Source Error:
Line 1: <%@ Page Language="C#" Trace=true %>
Line 2: <%@ Import Namespace="ac" %>
Line 3:
Line 4: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Source File: c:\Inetpub\wwwroot\DemoSite\Page1.aspx Line: 2


Nov 19 '05 #3

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

Similar topics

2
by: Xavier Decoret | last post by:
The following code does not compoile with gcc-3.2.3 namespace dummy { //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // Interface of Foo...
2
by: Zombie | last post by:
Hi all, I wish to create a namespace other than the default one. Let's say, the Schema looks like: ----------------------------------------------------------------------- <?xml version="1.0"...
6
by: clintonG | last post by:
Microsoft recommends CompanyName.TechnologyName and it all comes down to not breaking the inheritence model if I am not mistaken. VSN2003 however tells the compiler to use the name of the project...
8
by: Marcin Kalicinski | last post by:
Is the code below ill formed (because operator >> is defined in different namespace than class B)? It fails with VS 2005 Beta. I don't know if I should redesign my code or if I should find a...
7
by: Kevin Newman | last post by:
I've been toying with a namespace manager, and wanted to get some input. So what do you think? if (typeof com == 'undefined') var com = {}; if (!com.unFocus) com.unFocus = {}; ...
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...
14
by: Tiraman | last post by:
Hi , I would like to use nested namespace . I have 3 namespace as dll's : Namespace A Namespace B Namespace C And i want to have some namespace that contain them all , some thing like
6
by: antonyliu2002 | last post by:
Hi, guys, I am using Visual Web Developer Express 2005 for my web application. I wrote a simple class called MyTestClass.cs and put it in the App_Code folder. I compiled it to library from...
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...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.