可以和我的code中的C#交互窗口交互? [英] Can the C# interactive window interact with my code?

查看:195
本文介绍了可以和我的code中的C#交互窗口交互?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我装罗斯林。现在,如果我知道去哪里找在Visual Studio中,我可以打开C#交互窗口,并运行code:

 > 5 + 3
8
 

这就是可爱。现在,我怎么能互动的我的code 的 - 我的班?假设我有一个项目开放。

 >新的齿轮()
(1,5):错误CS0246:(?是否缺少using指令或程序集引用)类型或命名空间名称'齿轮'找不到
 

解决方案

您可以使用类从自己的项目。
只需右键点击你的解决方案,并选择从项目复位互动。

如果您需要了解更多信息,这里是源:
<一href="http://blog.filipekberg.se/2011/11/25/using-the-c-interactive-window-that-comes-with-roslyn-part-2/">Using C#的互动窗口,配备了罗斯林 - 第2部分

I installed Roslyn. Now, if I know where to look in Visual Studio, I can open the 'C# interactive window', and run code:

> 5 + 3
8

That's cute. Now how can I interact my code—my classes? Assume I have a project open.

> new Cog()
(1,5): error CS0246: The type or namespace name 'Cog' could not be found (are you missing a using directive or an assembly reference?)

解决方案

You can use classes from your own project.
Just right click on your solution and select "Reset Interactive from Project".

If you need more information, here is the source:
Using the C# Interactive Window that comes with Roslyn – Part 2

这篇关于可以和我的code中的C#交互窗口交互?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆