7

我需要为 VSTS 构建摘要选项卡开发一个相当复杂的 UI。我使用 VS Code 作为代码编辑器。以下 url 描述了如何使用 Edge 浏览器进行调试,但是这种方法需要不断地打包和部署 VSTS 扩展,这使得它非常耗时。 https://www.visualstudio.com/en-us/docs/integrate/extensions/test/debug-in-browser

我尝试使用在浏览器中查看扩展程序和浏览器控制台中显示的以下消息直接加载 .html(摘要选项卡),

No handler found on any channel for message: 
{"id":1,"methodName":"initialHandshake","instanceId":"VSS.HostControl","params":[{"notifyLoadSucceeded":true,"vssSDKVersion":2}],"jsonrpc":"2.0","handshakeToken":"4234q23rqfafaf23r"}

有没有更好的方法在开发时调试应用程序?

4

3 回答 3

5

You can develop locally. Since VSTS uses an iframe to show your extension's content, you can run a local server and reference that in the vss-extension.json manifest.

First, in the vss-extension.json, set the baseUri property to where you are running your project locally, such as https://localhost:8889. You need to be running it as https for VSTS to serve the content, as otherwise you will get a "Mixed Content" error and VSTS will refuse to display your extension's content.

Then, publish your extension and run it locally. Wha-la, you should have local development. There may be more trial and error needed, let me know if there's any steps that I'm missing.

If the link still works (you know how the Interent is), this starter project is a great start: https://github.com/Microsoft/vsts-extension-multivalue-control

于 2017-03-29T02:25:10.393 回答
2

不,如果不将扩展部署到 VSTS,则无法调试扩展代码,必须在调试代码之前将扩展部署到 VSTS。

于 2016-08-31T01:15:05.897 回答
0

初始部署后,您可以使用 Fiddler使用 FiddlerScript 或 AutoResponder 功能直接从磁盘返回文件。

于 2016-12-16T21:24:20.313 回答