0

我正在用 ASP.Net 编写一个 Web 应用程序。

在网页的顶部,我有:

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="software-mgr.aspx.vb" Inherits="ftp_access_software_mgr" EnableViewState="True" EnableSessionState="True" %>
<% 
    Dim ssMgr As SoftwareFTPStorage = New SoftwareFTPStorage
    Dim ssDBMgr As SoftwareStoreDBTools = New SoftwareStoreDBTools
    Dim username As String
    username = getUserName()

    If Not IsPostBack Then buildDBList()

%>

在 .aspx.vb 页面上,我有:

Imports SoftwareFTPStorage
Imports SoftwareStoreDBTools
Imports System
Imports System.Security
Imports System.Data.SqlClient
Imports System.Data.SqlClient.SqlConnection
Imports System.Data.SqlClient.SqlCommand

Partial Class ftp_access_software_mgr
    Inherits System.Web.UI.Page

    Dim ssDBTools As SoftwareStoreDBTools = New SoftwareStoreDBTools
    Dim ssMgrTools As SoftwareFTPStorage = New SoftwareFTPStorage

    Protected Sub Add_Click(sender As Object, e As System.EventArgs) Handles AddButton.Click
        ...Class Code
    End Sub

    Protected Sub RemButton_Click(sender As Object, e As System.EventArgs) Handles RemButton.Click
        ...Class Code
    End Sub

    Protected Sub buildDBList()
        ...Class Code
    End Sub

    Protected Function getUserName() As String
        ...Class Code
    End Function

End Class

我不知道我做了什么,但在服务器上的某个时刻我开始收到错误:

    Compilation Error 
    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: BC30002: Type 'SoftwareStoreDBTools' is not defined.

Source Error:

Line 10:     Inherits System.Web.UI.Page
Line 11: 
Line 12:     Dim ssDBTools As SoftwareStoreDBTools = New SoftwareStoreDBTools
Line 13:     Dim ssMgrTools As SoftwareFTPStorage = New SoftwareFTPStorage
Line 14: 

当我在本地调试时,它工作得很好......好吧,排序:仍在解决一些“状态”问题,但至少我没有得到错误页面。

有任何想法吗?

4

1 回答 1

0

检查这个,让我知道它是怎么回事:

http://forums.asp.net/t/1566777.aspx/1?class+in+App_code+not+defined+

http://p2p.wrox.com/asp-net-2-0-professional/64463-classes-app_code-not-defined.html

于 2012-07-31T22:34:23.287 回答