1

I have created an ASPX web application, that I have compiled and works fine when running through Visual Studio on my local PC.

However, on the server I get the error message

*Compiler Error Message: BC30451: 'epoDB' is not declared. It may be inaccessible due to its protection level. *

epoDB is a name of a class that I have that contains several methods. I am not using a "Code-Behind" file, this is just a separate file epoDB.vb. When I publish this website it is creating a 60 KB DLL in the BIN folder. I have checked the webConfig and it is set properly to allow all assemblies.

Here is some code: (ASPX PAGE)

<% @ Import Namespace="epoApprover" 
If Not Action = "X" Then Decrypted = epoDB.AES_Decrypt(RawString)
%>

The first time it hits this method AES_Decrypt, I am told epoDB is not declared.

Here is the epoDB.vb

Public Class epoDB    
    Public Shared Function AES_Decrypt(ByVal input As String) As String
       'decryption method
        Return decrypted
    End Function
End Class

This EpoDB.vb is a separate file. I have a few classes and it compiles into a 60KB epoApprover.dll , yet I don't seem to be able to access any of these classes.
Using .NET 4.0 / IIS6 / Windows 2003 64-bit.

I have tried many things, such as putting these classes in App_Code, leaving them on the root, yet nothing seems to work -- I think I am missing a fundamental. Any advice?

5
  • Have you tried fully qualifying the name? That would be my first diagnostic step Commented Jan 31, 2014 at 20:40
  • Have you added a reference to epoApprover in your executing app Commented Jan 31, 2014 at 20:40
  • Is this (epoApprover.dll) file in your bin directory? Commented Jan 31, 2014 at 20:45
  • I tried fully qualifying the name, to epoApprover.epoDb.AES_Decrypt() but then it tells me that epoApprover is not declared. The DLL was placed in the BIN directory, yes. @MikeTWebb, how do I go about doing that? Commented Jan 31, 2014 at 20:50
  • @User...you should be able to rright click on you project and "Add Reference" or there will be a References folder wher you right click and "Add Reference" Commented Feb 3, 2014 at 22:08

2 Answers 2

1

Turns out IIS was just setup as a web folder. Once I converted it to a web application it was able to find everything. I knew it was something fundamental!

Sign up to request clarification or add additional context in comments.

Comments

0

You are mixing your code with a Page declaration.

<% @ Import Namespace="epoApprover" 
If Not Action = "X" Then Decrypted = epoDB.AES_Decrypt(RawString)
%>

So:

<%@ Import Namespace="epoApprover"%>

<%     
    If foo Then
       ....
    End If    
%>

Though for inline style (not CodeFile nor CodeBehind) code is in:

<script runat="server">

   `Sub procs, Functions, etc.

</script>

Your .vb file should be in App_Code. Unsure how your code above worked on your local PC.

Hth...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.