473,799 Members | 3,098 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BC30466: Namespace or type cannot be found - different approach!

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 returnClass
Public Shared Function returnString() As String
Return "test"
End Function
End Class
End Namespace

I now want to import this class into an aspx file. My .net
intellisense picks up the namespace and class and allows me to import
it as follows:

Imports MyTest.returnCl ass

and kicks out zero errors!

When I fire up the aspx page I get the 'dreaded':-

Compiler Error Message: BC30466: Namespace or type 'returnClass' for
the Imports 'MyTest.returnC lass' cannot be found.

Note: The .vb file is not compiled but should compile at run time,
provided it is in the /code directory, should'nt it?

Help will be appreciated as would donations!
Nov 19 '05 #1
1 1610
If you are using source file in the /code directory
of your application, you don't need to import the
classes in the source files to your aspx files.

You can just reference them in your aspx file,
and they will work without references!

Visual Studio monitors the /Code directory and when
new components are added, compiles them.

The components in the Code subdirectory are
compiled by default into a single assembly.

The assembly is then automatically referenced
in the project and available to all pages in the site.

Eliminate :
Imports MyTest.returnCl ass and everything should work
[ unless you have other errors, of course... ;-) ]

Juan T. Llibre
ASP.NET MVP
===========
"sorCrer" <ju**@spirit.co .za> wrote in message
news:dc******** *************** ***@posting.goo gle.com... 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 returnClass
Public Shared Function returnString() As String
Return "test"
End Function
End Class
End Namespace

I now want to import this class into an aspx file. My .net
intellisense picks up the namespace and class and allows me to import
it as follows:

Imports MyTest.returnCl ass

and kicks out zero errors!

When I fire up the aspx page I get the 'dreaded':-

Compiler Error Message: BC30466: Namespace or type 'returnClass' for
the Imports 'MyTest.returnC lass' cannot be found.

Note: The .vb file is not compiled but should compile at run time,
provided it is in the /code directory, should'nt it?

Help will be appreciated as would donations!

Nov 19 '05 #2

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

Similar topics

1
2725
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a namespace prefix, what is its namespace, if default namespaces do not apply? Are (either of) prefixed or non-prefixed attributes correct? For example, are the following equivalent: <html:br class="foo"...
7
2104
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 that my implementation will only choose the partial specialization for std::vector when std::swap is used.
6
1669
by: SpOiLeR | last post by:
Why doesn't following code compile? Problem line is commented in code. ---------------------- Cut here------------------------------- #include <iostream> #include <list> #include <string> using namespace std;
20
3872
by: Patrick Guio | last post by:
Dear all, I have some problem with insertion operator together with namespace. I have a header file foo.h containing declaration of classes, typedefs and insertion operators for the typedefs in a named namespace namespace foo { class Foo
5
1374
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 test.vb, compiled to test.dll The namespace is called "test" This is the import: <%@ Import Namespace="test" %>
0
1326
by: George | last post by:
I have an aspx page, this page instance a Dll make for me, this Dll imports System.Data.OracleClient, I Add the Reference in the project and use the gcautil -i but the error "Namespace or type 'OracleClient' for the Imports 'System.Data.' cannot be found" persist, please help me, Sorry for my english Thanks......
2
1805
by: Phil Certain | last post by:
Hi, Relative newbie to .Net but experienced with classic ASP. I am trying to create a simple business object to contain commonly used functions. This is what I have done: 1 - Created a simple vb file containing: Imports System.Data.SqlClient Imports System.Web.HttpUtility
4
2528
by: David A | last post by:
I'm trying to "isolate" some unmanaged calls to DLLs in a separate namespace so I can have all the unmanaged calls to DLL functions in a separate module and then these can be called from any other module using the "Imports" statement. But I can't get it to work, at least not in the manner that I'd prefer. You can call the functions using the fully-qualified name, e.g. "MySpecial.UnmanagedCode.MyFunction". But I want to be able to work in...
3
2867
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 compile the code outside of Visual Studio if they need to adjust something I created. I have been trying to use vbc.exe, but I'm having problems with references to the DataSet I have created. Multiple pages reference my dataset - "DataSet1", ......
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10484
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.