为什么没有将Profile提供程序内置到Web Apps中?
时间:2020-03-05 18:39:57 来源:igfitidea点击:
如果创建ASP.NET Web文件项目,则可以直接访问web.config文件中的配置文件信息。如果将其转换为Web应用程序并一直使用ProfileCommon等,则必须跳过一大堆障碍才能使Web应用程序正常工作。
为什么没有像Web文件项目那样将Profile提供程序内置到ASP.NET Web应用程序项目中?
解决方案
回答
概要文件提供程序使用ASP.NET Build Provider系统,该系统不适用于Web应用程序项目。
Adding a customized BuildProvider class to the Web.config file works in an ASP.NET Web site but does not work in an ASP.NET Web application project. In a Web application project, the code that is generated by the BuildProvider class cannot be included in the application.
来源:MSDN Build Provider文档
回答
实际上,Microsoft确实有针对此已知问题的解决方案。
它是" Web Profiler Builder"。我将其用于我的Web应用程序,并且效果很好。
http://code.msdn.microsoft.com/WebProfileBuilder/Release/ProjectReleases.aspx?ReleaseId=980