Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PMC error when no config file #1162

Merged
merged 1 commit into from
Aug 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

@bricelam bricelam Aug 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These weren't wrong, just confusing. A second argument would have to be added after the closing parenthesis F($x) $y $z

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'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, new csproj returned null if the item didn't exist, but old csproj threw. Missed this since the .NET Framework Console template includes an app.config

$item = $project.ProjectItems |
where Name -eq $configFileName |
select -First 1

return GetProperty $item.Properties 'FullPath'
}

Export-ModuleMember -Variable 'InitialDatabase'