如何在 WebStorm 中调试 .NET 嵌入式 js 文件?
我想知道是否可以在 WebStorm 中调试 .net 嵌入式 js 文件?因为,实际上,真实文件中的断点不起作用。 .NET WebApplication 发送它自己的(压缩的)内容,不引用原始文件。
在这种情况下,我如何使用 WebStorm 调试器 调试 js?
更新(为了更好地理解问题)。 所以我有一个名为 dialog.js 的文件。我在 .net 项目配置中为此文件设置了“Embedded”属性。我已为此文件添加了程序集声明。所以它的行为就像.net 程序集。然后我使用 ScriptManager 将该程序集添加到队列中,并在客户端启动时加载。在该阶段 - 该文件加载的网址如 *http://site/ScriptResource.axd?d=AC9roCTnD0FDFmh4thoy3kzImrN7wKp9_WVOFcPes0Zzhg1&t=2aaf8bd5/eval/seq/70*。我无法使用 WebStorm 调试此文件 - 它合理地表示无法连接到文件 dialog.js。也许我需要指定/更改嵌入文件的 url 的命名规则(或重写 url)?
I'm wondered is it possible to debug .net embedded js files in WebStorm? Because, actually, breakpoints in the real file doesn't work. And .NET WebApplication sends it's own (zipped) content with no references to original file.
How I can debug js in that case, using WebStorm debugger?
UPDATE (for better understanding of the problem).
So I have file called, for example, dialog.js. I set the property "Embedded" for this file in .net project config. I've added assembly declaration for this file. So it behaves like .net assembly. Then I added that assembly with ScriptManager to queue, loaded on a client startup. And in that stage - this file is loaded with the url like *http://site/ScriptResource.axd?d=AC9roCTnD0FDFmh4thoy3kzImrN7wKp9_WVOFcPes0Zzhg1&t=2aaf8bd5/eval/seq/70*. And I'm not able to debug this file with WebStorm - it reasonably says that cannot connect to the file dialog.js. Maybe I need to specify/change the naming rules (or rewrite url) of the url for my embedded files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用浏览器调试器并调试客户端。 Chrome 和 IE9 内置了一个很好的插件,而 Firefox 有一个不错的插件可供使用。
好吧,当然我不使用 WebStorm,但从它的功能来看,WebStorm JS 调试器确实适合纯 HTML/JS 程序,不是服务器端代码。也就是说,这个小功能可以让您调试应用程序直接在火狐浏览器中。该示例指向一个文件,但如果它也不接受 URL,我会感到惊讶。尝试将其指向您的服务器端 .NET 应用程序,您应该能够调试有问题的 JS 文件。
Use a browser debugger and debug client-side. Chrome and IE9 come with a good one one built-in, and Firefox has a decent one available as a plugin.
Ok, granted I don't use WebStorm, but from a glance at its abilities it looks like the WebStorm JS debugger is really for pure HTML/JS programs, not server-side code. That said, there's this little feature that allows you to debug applications directly in Firefox. The example points toward a file, but I would be surprised if it didn't accept a URL as well. Try pointing that toward your server-side .NET application, and you should be able to debug the JS file in question.
我发现,你不需要担心底层的 Web 服务器是什么(apache、iis,等等),你甚至可以调试远程 http url。您要做的就是在 webstorm 中设置调试配置,使其指向您正在测试编辑配置中的“path”属性的 url。
I figured it out, you don't need to worry about what the underlying web server is (apache, iis, whatever), and you can even debug remote http urls. All you do is setup the debug config in webstorm to point to the url you are testing for the "path" attribute in the edit configuration.