我可以在Mono CSharpRepl中重新加载程序集吗? [英] Can I reload an assembly in Mono CSharpRepl?
问题描述
所以我来自Python背景,开始在Mac上使用C#和Mono.我最近找到了 Mono CSharpRepl工具,并希望使用它来实现类似的工作流程我在Python中具有的功能,其中包括在修复Python代码中的错误时反复调用"reload(module)". Mono的CSharpRepl是否具有类似的功能?目前,我只是退出,重新启动,然后再次调用'LoadAssembly()'和'using'语句,这很痛苦.
So I'm coming from a Python background and starting to get into C# and Mono on my Mac. I've just recently found the Mono CSharpRepl tool and would like to use it to achieve a similar workflow that I have in Python which includes repeatedly invoking 'reload(module)' as I fix errors in my Python code. Does Mono's CSharpRepl have similar functionality? Currently I've just been quitting, restarting, and then invoking 'LoadAssembly()' and 'using' statements again which is a pain.
推荐答案
$ csharp
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> var dom = AppDomain.CreateDomain("tmp");
csharp> dom.Load("System.Core");
System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
csharp> AppDomain.Unload(dom);
csharp>
我想这会做你想要的
这篇关于我可以在Mono CSharpRepl中重新加载程序集吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!