APP_ code里面的类文件的自动引用VS APP_ code以外的类文件的引用 [英] Automatic reference of class files inside App_Code vs reference of class files outside App_Code

查看:238
本文介绍了APP_ code里面的类文件的自动引用VS APP_ code以外的类文件的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有的问题请参考网站的项目。

all questions refer to Web site projects.

结果

1)为什么由内应用的其余部分自动引用APP_ code文件夹文件类,而文件中的类之外APP_ code创建不?

1) Why are file classes inside App_Code folder automatically referenced by the rest of application, while file classes created outside App_Code aren’t?

结果

2)我不知道很多有关编译,但为什么我们需要显式地引用类文件之外APP_ code产生的?由于这些文件将被编译成动态链接库创建和程序员,这样VS不知道这些DLL的名称,因此无法自动引用这些DLL命名?

2) I don’t know much about compilation, but why do we need to explicitly reference class files created outside App_Code? Because those files will be compiled into dlls created and named by programmer and as such VS doesn’t know what the names of these dlls and so can’t automatically reference these dlls?

3)外的文件默认情况下APP_ code没有得到自动编译?但是,为什么不?

3) Files outside App_Code by default don’t get automatically compiled? But why not?

结果

感谢名单

推荐答案

听起来好像你从一个网站项目期待Web应用程序的行为。

Sounds to me like you are expecting Web Application behaviour from a Web Site "project".

在网站的每个ASPX / ASHX文件(APP_ code以外)被认为是内容。在任何时候,你不妨简单地发布了一些文件到网站。因此,编译所有的人一下子到一个单一的组件是不可取的。

In a Web site each ASPX/ASHX file (outside of the App_Code) is considered content. At any point you may wish to simply publish a few of the files to the web site. Hence compiling all them at once into a single assembly is not desirable.

通过一个Web应用程序,你通常不公布只是几个文件,完成应用程序的阶段,编译在一起,然后发布。

With a Web Application you don't normally publish just a few files, you complete a phase of the application, compile it all together and then publish.

您似乎表明你有APP_ code之外申报的班?他们会在哪里,如果不是在自己的dll项目?如果在一个dll项目,那么你需要创建一个项目引用在Web站点属性。

You seem to indicate you have "classes" declared outside of App_Code? Where would they be if not in their own dll project? If in a dll project then you need to create a project reference to in the Web Site properties.

这篇关于APP_ code里面的类文件的自动引用VS APP_ code以外的类文件的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆