markus / packages / EntityFramework.4.3.1 / tools / install.ps1 @ 3e55f781
이력 | 보기 | 이력해설 | 다운로드 (1.11 KB)
1 |
param($installPath, $toolsPath, $package, $project) |
---|---|
2 |
|
3 |
$invoker = @" |
4 |
public class ConnectionFactoryConfiguratorInvoker |
5 |
{ |
6 |
public static void Invoke(string assemblyPath, object project) |
7 |
{ |
8 |
var appDomain = System.AppDomain.CreateDomain( |
9 |
"EntityFramework.PowerShell", |
10 |
null, |
11 |
new System.AppDomainSetup { ShadowCopyFiles = "true" }); |
12 |
|
13 |
appDomain.CreateInstanceFrom( |
14 |
assemblyPath, |
15 |
"System.Data.Entity.ConnectionFactoryConfig.ConnectionFactoryConfigurator", |
16 |
false, |
17 |
0, |
18 |
null, |
19 |
new object[] { project }, |
20 |
null, |
21 |
null); |
22 |
|
23 |
System.AppDomain.Unload(appDomain); |
24 |
} |
25 |
} |
26 |
"@ |
27 |
|
28 |
$version = (new-object System.Runtime.Versioning.FrameworkName($project.Properties.Item("TargetFrameworkMoniker").Value)).Version |
29 |
|
30 |
if ($version -ge (new-object System.Version(4, 5))) |
31 |
{ |
32 |
$dte.ItemOperations.OpenFile((Join-Path $toolsPath 'EF4.3on.NET4.5Readme.txt')) |
33 |
} |
34 |
|
35 |
Add-Type -TypeDefinition $invoker |
36 |
[ConnectionFactoryConfiguratorInvoker]::Invoke((Join-Path $toolsPath "EntityFramework.PowerShell.dll"), $project) |