我使用 Nu-Get 通过 Hibernating Rhinos 安装了 Entity Profiler 版本 2.02145.0。它安装了所需的程序集并创建了以下引导程序类:
using HibernatingRhinos.Profiler.Appender.EntityFramework;
[assembly: WebActivator.PreApplicationStartMethod(typeof(Application.Web.App_Start.EntityFrameworkProfilerBootstrapper), "PreStart")]
namespace Application.Web.App_Start
{
public static class EntityFrameworkProfilerBootstrapper
{
public static void PreStart()
{
// Initialize the profiler
EntityFrameworkProfiler.Initialize();
// You can also use the profiler in an offline manner.
// This will generate a file with a snapshot of all the EntityFramework activity in the application,
// which you can use for later analysis by loading the file into the profiler.
// var filename = @"c:\profiler-log";
// EntityFrameworkProfiler.InitializeOfflineProfiling(filename);
}
}
}
当我运行我的应用程序时,我在这一行收到此异常“名称空间'System.Data.Entity'中不存在类型或名称空间名称'Config'(您是否缺少程序集引用?)”EntityFrameworkProfiler.Initialize();
System.Data.Entity 在我的网络项目中被引用。
关于如何解决错误的任何想法?