简体   繁体   中英

How to debug .NET embedded js-files in WebStorm?

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?

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.

Yes. I'm pretty experienced with Firebug... But when I met WebStorm IDE, I felt in love. So I want to use JetBrains' debugger, not built-in one. Also I have experience with GWT technology and JetBrains' debugger was very cool (much more better then others). So my intention is to use WebStorm to debug javascript. – ajukraine

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM