简体   繁体   English

断点当前不会被命中,cshtml

[英]The breakpoint will not currently be hit, cshtml

In my Asp.Net Razor application i keep getting breakpoint will not currently be hit i have tried every single solution here the breakpoint will not currently be hit no symbols loaded with no luck. 在我的Asp.Net Razor应用程序中,我不断获得断点当前不会被击中我已经尝试了每一个解决方案,这里断点当前不会被击中没有符号加载没有运气。 So what should i do next? 那我接下来该怎么办?

Some Information: 一些信息:

  1. I am using Debug mode. 我正在使用调试模式。
  2. I am using Nancy.Templates to create a NancyFx project. 我正在使用Nancy.Templates创建一个NancyFx项目。
  3. The created project is set as Class Library. 创建的项目设置为类库。
  4. When i locate the module while code is running, it is loaded from GAC for some reason. 当我在代码运行时找到模块时,由于某种原因它从GAC加载。
  5. I tried every possible thing, clean rebuild, creating new fresh project to test on, re-installing visual studio, even windows. 我尝试了所有可能的事情,清理重建,创建新的测试项目,重新安装visual studio,甚至是windows。 Non works! 不起作用!
  6. I am running on Windows 8.1, using Visual Studio 2013 Ultimate, .Net 4.5.1 我使用Visual Studio 2013 Ultimate,.Net 4.5.1在Windows 8.1上运行

Here is my web.config 这是我的web.config

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <configSections>
    <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
    </sectionGroup>
  </configSections>

  <!--
    For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

    The following attributes can be set on the <httpRuntime> tag.
      <system.Web>
        <httpRuntime targetFramework="4.5.1" />
      </system.Web>
  -->
  <system.web>
    <compilation debug="true" targetFramework="4.5.1">

    <buildProviders>
        <add extension=".cshtml" type="Nancy.ViewEngines.Razor.BuildProviders.NancyCSharpRazorBuildProvider, Nancy.ViewEngines.Razor.BuildProviders" />
        <add extension=".vbhtml" type="Nancy.ViewEngines.Razor.BuildProviders.NancyVisualBasicRazorBuildProvider, Nancy.ViewEngines.Razor.BuildProviders" />
      </buildProviders></compilation>

    <pages controlRenderingCompatibilityVersion="4.0" />
  <httpHandlers>
      <add verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" />
    </httpHandlers></system.web>



<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <httpErrors existingResponse="PassThrough" />
    <handlers>
      <add name="Nancy" verb="*" type="Nancy.Hosting.Aspnet.NancyHttpRequestHandler" path="*" />
    </handlers>
  </system.webServer><appSettings>
    <add key="webPages:Enabled" value="false" />
  </appSettings><system.web.webPages.razor>
    <pages pageBaseType="Nancy.ViewEngines.Razor.NancyRazorViewBase">
      <namespaces>
        <add namespace="Nancy.ViewEngines.Razor" />
      </namespaces>
    </pages>
  </system.web.webPages.razor></configuration>

Here is the only .cshtml file i have in the solution: 这是我在解决方案中唯一的.cshtml文件:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title> //Here is the break point (i am able to add it) however when i start the application and browser run the breakpoint is not being hit

    <style type="text/css">

        body { 
            text-align: center;
        }

    </style>

</head>
<body>
    <img src="~/Content/nancy-logo.png" alt="Nancy logo" /><br />
    This view was rendered using the Nancy Razor view engine
</body>
</html>

Picture of the problem: 问题图片:

在此输入图像描述

The pdb file for the project exists! 该项目的pdb文件存在!

在此输入图像描述

如果没有控制器连接到调用.cshtml视图的视图,那么它将永远不会被加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 断点当前不会被命中 - 远程调试 - The breakpoint will not currently be hit - Remote Debugging VS 2022 17.1.3 目前不会断点 - VS 2022 17.1.3 The breakpoint will not currently be hit 如何修复 - 当前不会命中断点。 断点设置但尚未绑定? - how to fix - The breakpoint will not currently be hit. breakpoint set but not yet bound? 当前不会命中断点。 未在 Unity 中为该文档加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded for this document in Unity Visual Studio C#调试器 - 当前不会遇到断点 - Visual Studio C# debugger - the breakpoint will not currently be hit wcf 服务当前不会命中断点。 无法加载符号 - The breakpoint will not currently be hit wcf service. Can not load symbols 断点当前不会被命中,因为剃刀代码中的源代码不同 - Breakpoint will not currently be hit because source code is different in razor code 断点当前不会被命中。 没有为该文档加载符号 - The Breakpoint will not currently be hit. No symbols where loaded for this document VS 2013断点目前不会被击中。 没有为此文档加载任何符号 - VS 2013 the breakpoint will not currently be hit. no symbols have been loaded for this document 断点当前不会被命中。 没有为该文档加载任何符号。 删除dll时 - The breakpoint will not currently be hit. No symbols have been loaded for this document. when debussing dll
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM