Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload plugins/AppDomain for LINQPad

Tags:

linqpad

I've observed that if I refresh or reload the dll's in LINQPad's specified Plugins directory, that I must also close and re-open the current script for the library changes to take affect - which makes sense of course. My question is if there is a command or key that specifically does this reload without closing the script window?

like image 969
mdisibio Avatar asked Sep 26 '13 16:09

mdisibio


2 Answers

Try Ctrl + Shift + F5. That unloads the application domain. Then run the query again.

If you run into this a lot, you may want to look at the option Edit -> Preferences -> Advanced -> Execution -> Always use Fresh Application Domains.

like image 157
Ben Allred Avatar answered Oct 20 '22 12:10

Ben Allred


If you don't want to change the "Always Use Fresh Application Domains" option you can always unload the AppDomain yourself.

void Main()
{
    try
    {
        // Magic goes here
    }
    finally
    {
        AppDomain.Unload(AppDomain.CurrentDomain);
    }
}

You'll get a warning message after successfully executing this code (Query ended unexpectedly), but it's still beter than changing that global configuration setting.

like image 3
null Avatar answered Oct 20 '22 14:10

null