Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/257.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 托管ASP.NET网站后找不到类_C#_Asp.net_Webforms_Hosting_App Code - Fatal编程技术网

C# 托管ASP.NET网站后找不到类

C# 托管ASP.NET网站后找不到类,c#,asp.net,webforms,hosting,app-code,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 mo

我的项目是一个连接到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的接口。但是对于我试图引用的任何类,都会发生类似的错误

为什么我的项目托管后找不到任何类?

这和我的文件夹结构有关吗

我的课程不在App_代码文件夹中,因为显然网站不需要。不管怎样,我试着把它们放在App_代码文件夹中,但它给出了一个不同的错误


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

我的应用程序部署不正确。正如本·罗宾逊的评论所说:


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


你没有把源代码部署到服务器上,是吗?如果是这样,那么您应该部署编译的DLL。是的,我是。所以上图中的所有类都应该在DLL中?不要部署源代码。创建要部署的文件集合的最简单方法是使用visual studio中的“发布”选项。