简体   繁体   English

我的启动项目中的JS文件出现另一个“断点当前不会被击中”错误

[英]Yet Another 'The Breakpoint will not currently be hit' error for a JS file in my startup project

My company has hired another company to re-write our janky ASP / VB.NET web application to use C#, MVC 5, and the Razor View Engine. 我的公司雇用了另一家公司来重新编写我们的垃圾ASP / VB.NET Web应用程序,以使用C#,MVC 5和Razor View Engine。

Today, we've received the project back and I'm having some difficulties trying to determine why I cannot log in to the application. 今天,我们已经收到了项目,我在尝试确定为什么无法登录该应用程序时遇到了一些困难。

We have a working copy setup on one of our internal testing environments, but while trying to setup my local dev / test environment I am unable to get things going. 我们在一个内部测试环境中有一个工作副本设置,但是在尝试设置本地开发/测试环境时,我无法解决问题。 My boss said he hasn't set it up yet either so he won't be of any help. 我的老板说他还没有设置,所以他不会有任何帮助。 I don't know who set up QA's test environment. 我不知道是谁设置了质量检查的测试环境。

Anyways, I've matched my local IIS settings as closely as I can to the settings on the functioning test environment. 无论如何,我已经尽可能地将本地IIS设置与功能正常的测试环境上的设置进行了匹配。 When I launch the application and enter my credentials, I just see a spinning 'loading' icon which then disappears and does nothing. 当我启动该应用程序并输入凭据时,我仅看到一个旋转的“正在加载”图标,该图标随后消失并且不执行任何操作。 If I enter in bad data or missing data, the software prompts me with the appropriate errors. 如果我输入了错误的数据或丢失了数据,则软件会以适当的错误提示我。

I've tried to set a breakpoint in the JS that gets called to validate the login form but I just get the "breakpoint will not be current, no symbols loaded" error. 我试图在JS中设置一个断点,该断点被调用以验证登录表单,但是我只收到“断点将不是当前的,没有加载符号”错误。

This solution has 4 projects in it, and the JS file in question is in the startup Project that contains the login page. 该解决方案中有4个项目,所涉及的JS文件位于包含登录页面的启动项目中。

This startup project, MyProject.Web , contains the Views\\Central\\CentralLogin.cshtml file and ....\\Scripts\\Central\\Central.js file (which the view does have a reference to). 这个启动项目MyProject.Web包含Views \\ Central \\ CentralLogin.cshtml文件和.... \\ Scripts \\ Central \\ Central.js文件(该视图确实引用了该文件)。

I've gone to Debug -> Modules and it told me the .PDB was out of date. 我去了Debug-> Modules,它告诉我.PDB已过时。 Clean, rebuild, copy the file over to the directory specified (C:\\Windows\\SysWOW64\\inetsrv\\MyProject.Web.pdb). 清理,重建并将文件复制到指定的目录(C:\\ Windows \\ SysWOW64 \\ inetsrv \\ MyProject.Web.pdb)。 Re-launch the application and it says "Symbols loaded" when I re-open the "Symbol Load Information" screen. 重新启动该应用程序,并在我重新打开“符号加载信息”屏幕时显示“已加载符号”。 Despite that, setting a breakpoint in the JS gives the same "No symbol loaded" error. 尽管如此,在JS中设置断点仍会出现相同的“未加载符号”错误。

I've tried restarting IIS, restart the app pool, clean & rebuild my solution, copy over the new pdb to the folder it says it's looking at. 我尝试过重新启动IIS,重新启动应用程序池,清理和重建我的解决方案,将新的pdb复制到它正在查看的文件夹中。 As far as I can tell my IIS configuration matches our working test site. 据我所知,我的IIS配置与我们的工作测试站点匹配。 I also tried changing the Solution to contain "multiple startup projects" rather than specifying a single project. 我还尝试将解决方案更改为包含“多个启动项目”,而不是指定单个项目。

Solution Configuration is set to Configuration: Debug, Platform: Any CPU. 解决方案配置设置为配置:调试,平台:任何CPU。 I've tried IE, Chrome, and Firefox. 我已经尝试过IE,Chrome和Firefox。 All 3 give the same results. 所有3个给出相同的结果。

Any ideas what else I might try? 有什么想法我还能尝试吗? I read through at least 3 different StackOverflow posts citing this error and none of the solutions worked for me. 我引用了至少3个不同的StackOverflow帖子,指出此错误,但没有一种解决方案适合我。

The button on my page is defined as such: 我页面上的按钮定义如下:

<input tabindex="1" name="btnCredLogin" id="btnCredLogin" class=" button button-primary" type="button" value="Login" onclick="ValidateForm();">

Below that button, outside of the </html> tag, is this snippet of Razor code: 在该按钮下方</html>标记之外,是Razor代码的以下代码段:

@{
    var jsReference = System.Configuration.ConfigurationManager.AppSettings["DOWNLOADVERSION"].ToString();
}

<script src=@Url.Content("~/Scripts/Central/Central.js?v=" + jsReference)></script>

And it's that Central.js file which contains the ValidateForm() method that the button click event points to. 就是包含按钮单击事件指向的ValidateForm()方法的Central.js文件。 The app settings key to which jsReference refers simply contains the value "1.0" . jsReference引用的应用程序设置键仅包含值"1.0" So it's looking for Central.js?v=1.0 . 因此,它正在寻找Central.js?v=1.0 I tried scrapping that ?v=1.0 , so it just points to Central.js , but it doesn't change the results. 我试着废弃了?v=1.0 ,所以它只指向Central.js ,但不会改变结果。

I'm absolutely clueless as to why I cannot debug this JS file. 对于为什么无法调试此JS文件,我绝对一无所知。 Any clues? 有什么线索吗?

I agree that VS isn't the best debugging tool. 我同意VS不是最好的调试工具。 I would suggest using Chrome. 我建议使用Chrome。 Within Chrome developer tools settings, hit F1 and be sure the 'disable caching' is checked. 在Chrome开发人员工具设置中,点击F1并确保选中了“禁用缓存”。

For sanity check, I would break on your server CentralLogin code. 为了进行健全性检查,我将破坏您的服务器的CentralLogin代码。 I have gone thru a similar situation, and I was pointing to the wrong server. 我经历了类似的情况,并且指向错误的服务器。 I'll never get those 3 hours back.... 我再也回不到那三个小时了...

Your js callback is ValidateForm(). 您的js回调是ValidateForm()。 I would do a search all files for that method name. 我将在所有文件中搜索该方法名称。 Maybe there is another js file that is declaring this in the same global js scope and overwriting the one that you are looking for. 也许还有另一个js文件在同一全局js范围内声明了此文件,并覆盖了您要查找的文件。

Then try to open up the page in Chrome dev tools and to to the source tab. 然后尝试在Chrome开发者工具中打开页面并转到“源”选项卡。 Find your ValidateForm() function and set the breakpoint and then reload the page. 找到您的ValidateForm()函数并设置断点,然后重新加载页面。

You could put a ValidateForm() function in a script block on the cshtml page with an alert to see if that works. 您可以将ValidateForm()函数放在cshtml页面上的脚本块中,并带有警报以查看是否有效。

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

相关问题 TypeScript 调试错误 - 当前未命中断点 - 使用特殊字符时 - TypeScript debug error - the breakpoint not currently be hit - when use special character 无法点击.js文件内的断点 - can not hit breakpoint inside of .js file 调试 node.js 时出现“断点已设置但尚未绑定”错误 - “breakpoint set but not yet bound” error when debugging node.js 断点当前不会被击中。已调试的进程已加载不同版本的脚本文件 - The breakpoint will not currently be hit. A different version of script file has been loaded by debugged process 断点当前不会被命中。 没有在JavaScript中为此文档加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded for this document in JavaScript 断点当前不会被击中。 没有加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded 命中断点后编辑外部JavaScript文件 - Edit external JavaScript file after breakpoint is hit 断点未命中JS文件 - Breakpoint not hitting JS file 断点当前不会被命中。 与2013 javascript相比,此文档未加载任何符号 - the breakpoint will not currently be hit. no symbols have been loaded for this document vs 2013 javascript 断点当前不会被命中。 Windows Phone 8.1 phonegap应用程序中没有为该文档加载任何符号 - The breakpoint will not currently be hit. No symbols have been loaded for this document in Windows Phone 8.1 phonegap apps
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM