4

在 vs2008 我可以设置 App_Code 文件夹,但在 vs2010 我不能这样做,这就是为什么我将我的数据集和类'放到 App_Data 文件夹中。要么我不知道 App_Data 文件夹是否安全?有什么建议么?

谢谢

4

7 回答 7

9

请记住,它Web Site Project可以包含App_Code文件夹,Web Application Project但不能!因为所有项目都是为了代码。

于 2010-06-22T10:09:48.707 回答
4

如果要添加 App_Code 文件夹,则必须手动添加该文件夹。Add->Add New folder-->你必须给它文件夹名称“App_Code”,然后vs2010会自动改变它的文件夹类型。

祝你好运

于 2011-08-05T08:02:12.923 回答
2

If you want to use standalone class files (in "App_Code" dir) in VS 2010 project, be sure set the File Properties > Build Action for each *.cs or *.vb file to "Compile" in the Properties > Advanced dialog.

Also, use the same namespace as your project and these standalone classes will be readily available to the rest of your project.

Took me a bit to realize the default setting in my VS was "Content" instead of "Compile."

于 2012-10-05T14:09:13.567 回答
1

您是否尝试在解决方案资源管理器中右键单击该项目,选择“添加...”并在 ASP.NET 文件夹下查看?

从内存来看,即使是以前版本的 VS,默认情况下也不会自动将 App_Code 文件夹放入您的项目中。

于 2010-06-22T10:02:48.793 回答
0

If you just create a folder called App_Code it will recognise it as the App_Code you want, it is strange that in the add .net folder it doesnt appear.

This the route I took for it, and it all works fine.

于 2010-06-22T13:01:02.157 回答
0

解决方法:

如果我们在 Web 应用程序项目中使用 App_Code,我们需要重命名为任何其他文件夹名称。

http://blogs.msdn.com/b/chiranth/archive/2014/02/19/visual-studio-2012-unexpected-behavior-crash-and-irrelevant-errors.aspx

于 2015-12-03T14:10:24.333 回答
-2

我希望这会对您有所帮助 - .cs 文件不应放在文件夹中。只需将它们单独放在项目中,而不是放在文件夹中。然后您的课程将可见。这是 VS 2010 的不同之处。

于 2011-01-28T00:57:48.463 回答