visual-studio-2012 - Visual Studio 是如何对 App_Code 文件夹进行特殊处理的?

标签 visual-studio-2012 web-site-project app-code

当在 App_Code 文件夹中进行更改或检测到更改时,Visual Studio 如何处理 App_Code 文件夹?不是 IIS 或 ASP.NET。

我想更好地理解为什么每当我将代码文件保存在网站项目的大型 App_Code 文件夹中时,Visual Studio 会长时间卡住。或者,我可能会问:为什么 Visual Studio 在处理同样大的类库中的文件时没有表现出这些相同的卡住?

理想情况下,我希望看到 Microsoft 引用的官方文档,说明在 Visual Studio 中处理 App_Code 文件夹时遇到的问题,以及与处理类库不同的情况。

最佳答案

The App_Code folder is not explicitly marked as containing files written in any one programming language. Instead, the ASP.NET infers which compiler to invoke for the App_Code folder based on the files it contains. If the App_Code folder contains .vb files, ASP.NET uses the Visual Basic compiler; if it contains .cs files, ASP.NET uses the C# compiler, and so on.

If the App_Code folder contains only files where the programming language is ambiguous, such as a .wsdl file, ASP.NET uses the default compiler for Web applications, as established in the compilation element of the application Web.config file or the machine-level Web.config file. Compilers are named build providers and a build provider is specified for each file extension in an extension element.

参见 documentation在这里。

关于visual-studio-2012 - Visual Studio 是如何对 App_Code 文件夹进行特殊处理的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18478566/

相关文章:

c# - 是否可以向 App_Code 添加两种语言代码文件,即 C# 和 VB.NET?如果是这样,我怎么能做到这一点?

asp.net - Global.asax.cs 无法访问 App_Code 中的类

c++ - 用于从 C++ 代码中提取函数的正则表达式

c++ - 移动构造函数和继承

php - 使用 php 或 javascript 将数据从 excel 导入到 Html 网站哪个更好?

google-app-engine - 如何为 404 错误添加自定义错误页面(找不到页面)

javascript - 将 Html/Css/JS 导入 CMS?

version-control - Visual Studio 2012 项目已修改外部环境提示

c++ - 如何在 Visual Studio 中根据字符串比较设置条件断点?

c# - App_Code 文件夹问题