简体   繁体   English

Visual Studio 2015 中是否有 Visual Basic 交互式窗口?

[英]Is there a Visual Basic Interactive Window in Visual Studio 2015?

Is this possible to have a Visual Basic Interactive window in Visual Studio 2015 like we have for C#?在 Visual Studio 2015 中是否可以像在 C# 中那样拥有 Visual Basic Interactive 窗口?

在此处输入图片说明

At the time of writing the original answer to this, VB.net interactive was in the pipeline, but no longer.在撰写对此的原始答案时,VB.net Interactive 正在筹备中,但不再存在。 As this answer had been accepted, I can't delete it, so here it stays :-/由于这个答案已被接受,我无法删除它,所以它保留在这里:-/

对于那些从谷歌来到这里的人,不,在我写这篇文章的时候,VS 2019 中没有 VB 交互窗口,他们也不打算实现它。

If you clone the Roslyn repository from GitHub ( https://github.com/dotnet/roslyn ) one of the projects is called vbi, and you can produce a non-GUI version of C# Interactive (no Intellisense obviously) that does a lot of what C# Interactive does.如果您从 GitHub ( https://github.com/dotnet/roslyn ) 克隆 Roslyn 存储库,其中一个项目称为 vbi,您可以生成一个非 GUI 版本的 C# Interactive(显然没有 Intellisense),它可以做很多事情C# Interactive 的作用。

From a brief investigation it seems to need each line expressed as a function/method call, eg, evaluating 3 + 4 gives you an error, but System.Console.WriteLine(3 + 4) displays 7 (you also seem to have to full qualify methods).从一个简短的调查来看,它似乎需要将每一行表示为一个函数/方法调用,例如,评估 3 + 4 会给你一个错误,但 System.Console.WriteLine(3 + 4) 显示 7(你似乎也必须满限定方法)。 However you can evaluation System.Math.Pow(2, 7) and get 128 as the answer.但是,您可以评估 System.Math.Pow(2, 7) 并得到 128 作为答案。

Since it's VB input is case insensitive so system.console.writeline(3 + 4) works.由于它的 VB 输入不区分大小写,所以 system.console.writeline(3 + 4) 可以工作。

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

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