이 코드는 Visual Studio 2010이 설치된 로컬 컴퓨터에서 올바르게 작동하며 은 .NET Framework 2.0에서 작동하지만 2.0에서 내 서버를 업그레이드했을 때 제대로 작동합니다. 어떤 수있는 신체의 도움Asp.Net 내 서버를 2.0에서 4.0으로 업그레이드 할 때 오류가 발생했습니다
Server Error in '/' Application.
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: CS0246: The type or namespace name 'staticpage_namespace' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 10: using System.Web.UI.HtmlControls;
Line 11: using System.Data.SqlClient;
Line 12: using staticpage_namespace;
Line 13:
Line 14:
: 4.0 에이 오류를주고있다? 여기
내가 App_Code 폴더에 클래스에 사용하고있는 코드입니다 : -namespace staticpage_namespace
{
public class Staticpage
{
......
public SqlDataReader InsertHome()
{
SqlDataReader dr = SqlHelper.ExecuteReader(configclass.DbConn, CommandType.StoredProcedure, "InsertHome");
return dr;
}
public Staticpage()
{
//
// TODO: Add constructor logic here
//
}
}
}
그리고 이것은 내 웹 양식에 대한 코드입니다 : -
using staticpage_namespace;
public partial class _Default1 : System.Web.UI.Page
{
}
Web.Config에을 추가 했습니까? –
예,이 줄을 web.config 파일에 포함 시켰습니다. – bhanu
app_code 폴더에 추가하거나이 네임 스페이스에 대한 참조를 추가하십시오. –