Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

BC30466: Namespace or type 'testNS' for the Imports 'testNS' cannot be found.

Hey,
  I'm trying to create a custom namespace that I can call from all my pages.
Here is the .vb code:

Namespace testNS
      Public Class testCls
            Public Sub testNamespace()
                  'do nothing
            End Sub
      End Class
End Namespace


The compiler command:

vbc /target:library /out:bin\testNS.dll testNS.vb


The aspx page:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%@Import Namespace="testNS" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

</body>
</html>



This doesn't do anything, but I'm using it to test.
The compiler runs without errors and creates a dll file in the \bin directory under my app folder.
When I load the aspx page I get this message:


Compiler Error Message: BC30466: Namespace or type 'testNS' for the Imports 'testNS' cannot be found.

Source Error:

Line 26: Imports System.Web.UI.HtmlControls
Line 27: Imports System.Web.UI.WebControls
Line 28: Imports testNS
Line 29:
Line 30: Namespace ASP


Source File: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\d16a94c5\8b912d73\py1siljr.0.vb    Line: 28


Anyone know why this is happening?
I could use some help on this one.

Thanks,
curlypinhead
0
curlypinhead
Asked:
curlypinhead
  • 3
  • 2
1 Solution
 
sachiekCommented:
Hi,
  I did the same you had given. It is working fine.
  I guess unless you had typed wrong Namespace or not correctly updated that DLL in bin this error will be coming for your.
  double check your namespace typed in your class file and wether DLL is correctly there in bin folder.

   To get your exact error i changed delebrately the namespace imported in aspx page to testNS1. I got the same error which you had posted above. That says all .  Hope you got it correct this time.

sachi
0
 
curlypinheadAuthor Commented:
I checked the spelling on all files (it looks exactly as above, in the original question).  What else could it be?  Any ideas?

Thanks,
curlypinhead
0
 
curlypinheadAuthor Commented:
Do you have to register the dll file or something?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
sachiekCommented:
You dont need to register DLL.


Sachi
0
 
curlypinheadAuthor Commented:
Hey,
  I figured out the suolution...

In IIS, you need to setup the directory for the project as an application.  Unless you do this, IIS does not look into the .\bin directory for dlls.

Please refund points.

Thanks,
curlypinhead
0
 
moduloCommented:
PAQed with points refunded (200)

modulo
Community Support Moderator
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now