Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# MiniProfiler在首先使用实体框架数据库运行Web窗体应用程序时不显示分析信息覆盖_C#_Asp.net_Entity Framework_Webforms_Mvc Mini Profiler - Fatal编程技术网

C# MiniProfiler在首先使用实体框架数据库运行Web窗体应用程序时不显示分析信息覆盖

C# MiniProfiler在首先使用实体框架数据库运行Web窗体应用程序时不显示分析信息覆盖,c#,asp.net,entity-framework,webforms,mvc-mini-profiler,C#,Asp.net,Entity Framework,Webforms,Mvc Mini Profiler,我一直遵循上显示的设置 我在我的Web应用程序中引用了EntityFramework v4.3.1NuGet包,只是为了让MiniProfiler工作,但是EF.edmx和生成的模型在一个单独的引用项目中 我也在使用 MiniProfile.EF v2.1.0 MiniProfiler v2.1.0 我的web应用程序global.asax.cs如下所示 public class Global : HttpApplication { private void Application_

我一直遵循上显示的设置

我在我的Web应用程序中引用了
EntityFramework v4.3.1
NuGet包,只是为了让
MiniProfiler
工作,但是EF
.edmx
和生成的模型在一个单独的引用项目中

我也在使用

MiniProfile.EF v2.1.0
MiniProfiler v2.1.0
我的web应用程序
global.asax.cs
如下所示

public class Global : HttpApplication
{
    private void Application_Start(object sender, EventArgs e)
    {
        MiniProfilerEF.Initialize();
        //MiniProfilerEF.InitializeEF42();

        // Code that runs on application startup
        InitProfilerSettings();
    }

    protected void Application_BeginRequest()
    {
        if (Request.IsLocal)
        {
            MiniProfiler.Start();
        }
    }

    private void Application_End(object sender, EventArgs e)
    {
        MiniProfiler.Stop();
    }


    private void InitProfilerSettings()
    {
        // some things should never be seen
        var ignored = MiniProfiler.Settings.IgnoredPaths.ToList();
        ignored.Add("/Styles/");
        ignored.Add("/Scripts/");
        ignored.Add("/files/");
        ignored.Add("/images/");
        MiniProfiler.Settings.IgnoredPaths = ignored.ToArray();

        MiniProfiler.Settings.SqlFormatter = new StackExchange.Profiling.SqlFormatters.InlineFormatter();
    }

}
我已经在我的
web.config
中添加了一个处理程序,如下所示

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
    <handlers>
        <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
    </handlers>
  </system.webServer>
所有这些似乎都可以工作,我可以在本地运行我的应用程序,我可以查看页面源代码并查看此脚本块,在Chrome中,我可以选择include.js链接并查看内容

<script async type="text/javascript" id="mini-profiler" src="/mini-profiler-resources/includes.js?v=xwYPDDH1blvqmxgsBweNC++H7CFU3KGQ+zFcVlJPsXw=" data-version="xwYPDDH1blvqmxgsBweNC++H7CFU3KGQ+zFcVlJPsXw=" data-path="/mini-profiler-resources/" data-current-id="adf7a5f4-482d-4f65-b09e-e3c59b157134" data-ids="adf7a5f4-482d-4f65-b09e-e3c59b157134" data-position="left" data-trivial="false" data-children="false" data-max-traces="15" data-controls="false" data-authorized="true" data-toggle-shortcut="Alt+P" data-start-hidden="false"></script>
我本来希望增加相关的处理程序可以解决我的问题:(但是没有

感谢您的帮助

         //var _modelContext = new Entities();
        // ConfigurationManager.ConnectionStrings["Entities"].ConnectionString
        //var profiledConnection = new EFProfiledDbConnection(new Entities().Connection, MiniProfiler.Current);
        var profiledConnection = new EFProfiledDbConnection(new SqlConnection(ConfigurationManager.ConnectionStrings["EntitiesSql"].ConnectionString), MiniProfiler.Current);
        var _modelContext = ObjectContextUtils.CreateObjectContext<Entities>(profiledConnection); 
<script async type="text/javascript" id="mini-profiler" src="/mini-profiler-resources/includes.js?v=xwYPDDH1blvqmxgsBweNC++H7CFU3KGQ+zFcVlJPsXw=" data-version="xwYPDDH1blvqmxgsBweNC++H7CFU3KGQ+zFcVlJPsXw=" data-path="/mini-profiler-resources/" data-current-id="adf7a5f4-482d-4f65-b09e-e3c59b157134" data-ids="adf7a5f4-482d-4f65-b09e-e3c59b157134" data-position="left" data-trivial="false" data-children="false" data-max-traces="15" data-controls="false" data-authorized="true" data-toggle-shortcut="Alt+P" data-start-hidden="false"></script>
POST http://localhost:54406/mini-profiler-resources/results 404 (Not Found)