param($installPath, $toolsPath, $package, $project)

$invoker = @"
public class SqlCompactConnectionFactoryConfiguratorInvoker
{
    public static void Invoke(string assemblyPath, object project)
    {
        var appDomain = System.AppDomain.CreateDomain(
            "EntityFramework.PowerShell",
            null, 
            new System.AppDomainSetup { ShadowCopyFiles = "true" });

        appDomain.CreateInstanceFrom(
            assemblyPath, 
            "System.Data.Entity.ConnectionFactoryConfig.SqlCompactConnectionFactoryConfigurator",
            false,
            0,
            null,
            new object[] { project },
            null,
            null);

        System.AppDomain.Unload(appDomain);
    }
}
"@

Add-Type -TypeDefinition $invoker
[SqlCompactConnectionFactoryConfiguratorInvoker]::Invoke((Join-Path $toolsPath "EntityFramework.PowerShell.dll"), $project)

# SIG # Begin signature block
# MIIaSgYJKoZIhvcNAQcCoIIaOzCCGjcCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUX1kOhZ6Y7NO+uGyk3pl35s7T
# SOegghUmMIIEmTCCA4GgAwIBAgITMwAAAJ0ejSeuuPPYOAABAAAAnTANBgkqhkiG
# 9w0BAQUFADB5MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G
# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSMw
# IQYDVQQDExpNaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQTAeFw0xMjA5MDQyMTQy
# MDlaFw0xMzAzMDQyMTQyMDlaMIGDMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz
# aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENv
# cnBvcmF0aW9uMQ0wCwYDVQQLEwRNT1BSMR4wHAYDVQQDExVNaWNyb3NvZnQgQ29y
# cG9yY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