Skip to content

Commit

Permalink
Fix PMC error when no config file
Browse files Browse the repository at this point in the history
Fixes #1143
  • Loading branch information
bricelam committed Aug 19, 2019
1 parent dcce4d2 commit 2cc8cee
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/NuGet/EntityFramework/tools/EntityFramework6.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Add-EFProvider
[parameter(Position = 2, Mandatory = $true)]
[string] $TypeName)

$configPath = GetConfigPath($Project)
$configPath = GetConfigPath $Project
if (!$configPath)
{
return
Expand Down Expand Up @@ -110,7 +110,7 @@ function Add-EFDefaultConnectionFactory
[string] $TypeName,
[string[]] $ConstructorArguments)

$configPath = GetConfigPath($Project)
$configPath = GetConfigPath $Project
if (!$configPath)
{
return
Expand Down Expand Up @@ -1205,7 +1205,11 @@ function GetConfigPath($project)
$configFileName = 'app.config'
}

return GetProperty $project.ProjectItems.Item($configFileName).Properties 'FullPath'
$item = $project.ProjectItems |
where Name -eq $configFileName |
select -First 1

return GetProperty $item.Properties 'FullPath'
}

Export-ModuleMember -Variable 'InitialDatabase'

0 comments on commit 2cc8cee

Please sign in to comment.