相关疑难解决方法(0)

AppDomain 卷影复制不起作用(原始程序集已锁定)

Here's a small class I'm using to probe for a list of available plugins:

internal static class PluginDirectoryLoader
{
    public static PluginInfo[] ListPlugins(string path)
    {
        var name = Path.GetFileName(path);
        var setup = new AppDomainSetup
        {
            ApplicationBase = path,
            ShadowCopyFiles = "true"
        };
        var appdomain = AppDomain.CreateDomain("PluginDirectoryLoader." + name, null, setup);
        var exts = (IServerExtensionDiscovery)appdomain.CreateInstanceAndUnwrap("ServerX.Common", "ServerX.Common.ServerExtensionDiscovery");
        PluginInfo[] plugins = null;
        try
        {
            plugins = exts.ListPlugins(); // <-- BREAK HERE
        }
        catch
        {
            // to do
        }
        finally
        {
            AppDomain.Unload(appdomain);
        }
        return …
Run Code Online (Sandbox Code Playgroud)

.net c# reflection shadow-copy appdomain

3
推荐指数
1
解决办法
3218
查看次数

标签 统计

.net ×1

appdomain ×1

c# ×1

reflection ×1

shadow-copy ×1