立即导入项目
Import Project to Immediate
刚刚安装了 VS2015 Update 1,我发现了 C# Interactive window。
根据该系列中的 second post,您应该能够从您的解决方案中导入项目。
When you want to fire up the C# Interactive Window you can just right click your solution and select "Reset Interactive from Project"
但是,这个选项在我的项目中不可用。我正在使用控制台应用程序进行测试,并将框架从 4.5 升级到 4.6.1。然而,这并没有奏效。
此外,我尝试手动导入项目。查看网站上的屏幕截图,我应该可以这样做:#r "ConsoleApplication7.exe"
但是当我这样做时,出现以下异常:
(1,1): error CS0006: Metadata file 'ConsoleApplication7.exe' could not be found
它将通过文件路径引入,例如:
#r "bin\Debug\ConsoleApplication7.exe"
然而,这有点笨拙。特别是因为每当您对 类 进行更改时,它都需要 #reset
并重新导入。
有没有更好的方法将 Projects 导入到 Immediate 实例中?
根据 Jason Malinowski 的评论
It doesn't really answer your question, but unfortunately we had to cut the "Reset from Project" command in Visual Studio 2015 Update 1 just because we were crunched getting everything else done. We don't like that it's not there either.
因此,目前(2016-02-04),“从项目中重置”选项不可用。
项目可以手动导入,使用以下命令:
#r "bin\Debug\ConsoleApplication7.exe"
当您是 运行 REPL,在同一实例中打开解决方案,并且只有一个项目时,这应该有效。
其他时候,您需要使用完整的文件路径
#r "C:\MySolution\ConsoleApplication7\bin\Debug\ConsoleApplication7.exe"
刚刚安装了 VS2015 Update 1,我发现了 C# Interactive window。
根据该系列中的 second post,您应该能够从您的解决方案中导入项目。
When you want to fire up the C# Interactive Window you can just right click your solution and select "Reset Interactive from Project"
但是,这个选项在我的项目中不可用。我正在使用控制台应用程序进行测试,并将框架从 4.5 升级到 4.6.1。然而,这并没有奏效。
此外,我尝试手动导入项目。查看网站上的屏幕截图,我应该可以这样做:#r "ConsoleApplication7.exe"
但是当我这样做时,出现以下异常:
(1,1): error CS0006: Metadata file 'ConsoleApplication7.exe' could not be found
它将通过文件路径引入,例如:
#r "bin\Debug\ConsoleApplication7.exe"
然而,这有点笨拙。特别是因为每当您对 类 进行更改时,它都需要 #reset
并重新导入。
有没有更好的方法将 Projects 导入到 Immediate 实例中?
根据 Jason Malinowski 的评论
It doesn't really answer your question, but unfortunately we had to cut the "Reset from Project" command in Visual Studio 2015 Update 1 just because we were crunched getting everything else done. We don't like that it's not there either.
因此,目前(2016-02-04),“从项目中重置”选项不可用。
项目可以手动导入,使用以下命令:
#r "bin\Debug\ConsoleApplication7.exe"
当您是 运行 REPL,在同一实例中打开解决方案,并且只有一个项目时,这应该有效。
其他时候,您需要使用完整的文件路径
#r "C:\MySolution\ConsoleApplication7\bin\Debug\ConsoleApplication7.exe"