在Visual Studio 2015或更高版本中,我可以打开“ C#交互式窗口”,然后运行代码:
> 5 + 3
8那很可爱。现在我该如何交互我的代码(我的类)?假设我有一个开放的项目。
> 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?)
                  Roslyn不是交互式窗口。它是.NET编译器API。您确定不遗漏这些东西吗?
                
                
                  
                    —
                    Tigran 2012年
                    
                  
                
              
                  为此,我始终使用标准的即时窗口-也可以使用您自己的类型。
                
                
                  
                    —
                    Polyfun 2012年
                    
                  
                
              
                  什么是“标准即时窗口”?
                
                
                  
                    —
                    上校恐慌
                    
                  
                
              
                  @MattHickford有关更多信息,请参阅我的最新答案
                
                
                  
                    —
                    懒惰
                    
                  
                
              

