一旦托管ASP.NET网站,就无法找到类

时间:2014-12-15 14:15:15

标签: c# asp.net webforms hosting app-code

我的项目是连接到SQL数据库的ASP.Net网站。 它在Visual Studio中本地编译很好,但是一旦它被托管(myWindowsHosting.com),就会抛出这个错误:

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 'IDefaultView' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 9:  namespace HFDB2
Line 10: {
Line 11:     public partial class Default : System.Web.UI.Page, IDefaultView
Line 12:     {
Line 13:         public event EventHandler btnNextClicked;

在这个例子中,我试图实现一个默认webform的接口。但是我尝试引用的任何类都会出现类似的错误。

为什么我的项目在托管后无法找到任何课程?

是否与我的文件夹结构有关?

enter image description here

我的课程不在App_Code文件夹中,因为显然你不需要一个网站。无论如何,我尝试将它们放在App_Code文件夹中,但它给出了不同的错误。

请注意,我将您在项目文件夹中看到的所有内容上传到主机。

1 个答案:

答案 0 :(得分:0)

我正在部署我的应用程序错误。正如本罗宾逊的评论所说:

  

永远不要部署源代码。创建要部署的文件集合的最简单方法是使用visual studio中的“发布”选项。