开发者

Can I reload an assembly in Mono CSharpRepl?

开发者 https://www.devze.com 2023-02-23 08:29 出处:网络
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

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>  

This will do what you want, I presume


I'm afraid this might be tricky, .Net has no way to unload an assembly apart from discarding whole AppDomain - which probably won't be any easier than restarting CSharpRepl.

0

精彩评论

暂无评论...
验证码 换一张
取 消