bingles
bingles

Reputation: 12203

WebStorm ASP.NET MVC JavaScript Debugging

Does anyone know how to use WebStorm for JavaScript debugging of an ASP.NET MVC application? I am running my ASP.NET MVC application locally using IIS, and I am trying to use WebStorm's remote debugging features to step into JavaScript code. My understanding so far is that you can map local files to the hosted ones, but I'm not sure how to do this since my local files are razor views and don't map 1-to-1 to the HTML that is served via IIS. Any suggestions on how to set this up, or resources on how to do so, would be greatly appreciated.

Upvotes: 3

Views: 3594

Answers (2)

Paul Sweatte
Paul Sweatte

Reputation: 24617

Debugging JavaScript is the same no matter the backend:

  • setup a minified/unminified toggle via a cookie or query param
  • check the console for errors in the unminified code
  • set up breakpoints to see what is causing the error
  • use the browser developer tool to test possible solutions

There are also remote debugging IIS instructions as well as cross-domain JavaScript setup information.

References

Upvotes: 0

Mule
Mule

Reputation: 878

I just found your question searching for answers to a different question.

I am running a web application using ASP.NET MVC 5 and several C# libraries supporting it. We use AngularJS and I spend 90% of my time developing in JS on this project. I just downloaded WebStorm 7 as a trial and I created a new project that points to the directory that contains all of my ASP.NET MVC HTML/JS files (it's my entire ASP.NET web project, which excludes my C# libraries, etc.). I am able to set debug breakpoints in WebStorm on my JS files, and it all works well - super easy. This is one option for debugging your ASP.NET app via WebStorm.

The alternative is to use your browser's dev tools, then make changes to your JS files in VS. Otherwise, getting debugging to work in WebStorm was fast and easy.

It has been 1.5 years since you posted this question, so you have moved on I am sure, but for anyone else reading this - hope that helps.

Upvotes: 5

Related Questions