简体   繁体   中英

Debug Javascript in UWP in Visual Studio 2015

I am using Visual Studio 2015 on Windows 10, and am building a Universal Windows App in C# (XAML). I have added a WebView and thereon some HTML/JS content in it.
Is there a way to debug the JS content line by line? (Similar to using F10 / F11 for C# code)

Yes you have to set the properties of the project : right click > properties > Debug > Debugger type > Application process > Script.

If you need to debug your C# code AND your JS code, you can choose the value "Managed Only" in the project Properties. For the JS code, you can use an external solution like VorlonJS : http://vorlonjs.com/ . It's easy to setup and very powerful.

For those who ask same question for VS 2019, it is possible to debug a WebView app with the help of Microsoft Edge DevTools Preview

I think it works on VS 2015 too because it seems to use MS EDGE not depending on Visual Studio.

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