配置文件服务在 ASP.NET Web 项目中的 Page_Load 代码中不可用
用于 ASP.NET 配置文件服务的配置文件在文件后面的页面代码(如 Page_Load)中不可用。
这可能只是 Visual Studio 安装/配置的问题,但另一个问题是,放置在 App_Code 中的类在页面代码中看不到。即使我将新的 ASP.NET 文件夹添加到我的项目中,“App_Code”也不能作为选项使用。
我使用 ASP.NET Web 项目和空 ASP.NET Web 项目测试了整个场景。创建 ASP.NET 网站时确实存在此问题。
环境:Visual Studio 2010 Ultimate x64、ASP.NET 4.0、Windows Server 2008 R2 x64。
可能是什么问题以及如何解决?
Profile that is used for ASP.NET Profile Service is not available in Page code behind files like in Page_Load.
It may be just a problem with Visual Studio installation/configuration, but as another problem, classes placed in App_Code in not seen in page codes. Even when I'm adding new ASP.NET folder to my project, "App_Code" is not available as an option.
I tested the entire scenario with ASP.NET Web Project and Empty ASP.NET Web Project. This problem does exists while creating ASP.NET Website.
Environment: Visual Studio 2010 Ultimate x64, ASP.NET 4.0, Windows Server 2008 R2 x64.
What may be the problem and how it can be solved?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
配置文件只能在网站模板中开箱即用。
要在 Web 项目中使用配置文件,您需要应用可用的解决方法 此处< /a>。
http://code.msdn.microsoft.com/WebProfileBuilder
http://weblogs.asp.net /joerobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx
Profiles only Work Out-of-the-Box with the Web Site Template.
To use Profile in Web project you need to apply a work-around that is available here.
http://code.msdn.microsoft.com/WebProfileBuilder
http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx