简体   繁体   English

在 Visual Studio 2015 中的 UWP 中调试 Javascript

[英]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).我在 Windows 10 上使用 Visual Studio 2015,并在 C# (XAML) 中构建通用 Windows 应用程序。 I have added a WebView and thereon some HTML/JS content in it.我添加了一个WebView并在其中添加了一些 HTML/JS 内容。
Is there a way to debug the JS content line by line?有没有办法逐行调试JS内容? (Similar to using F10 / F11 for C# code) (类似于对 C# 代码使用 F10 / F11)

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.如果您需要调试您的 C# 代码和您的 JS 代码,您可以在项目属性中选择值“Managed Only”。 For the JS code, you can use an external solution like VorlonJS : http://vorlonjs.com/ .对于 JS 代码,您可以使用像 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对于那些对 VS 2019 提出相同问题的人,可以借助Microsoft Edge DevTools Preview来调试 WebView 应用程序

I think it works on VS 2015 too because it seems to use MS EDGE not depending on Visual Studio.我认为它也适用于 VS 2015,因为它似乎使用不依赖于 Visual Studio 的 MS EDGE。

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

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