Repro steps:
1. Create a project
2. Install EntityFramework package
3. Close solution
4. Type Enable-Migrations on Package Manager Console
Expected:
Get a simple error saying that we couldn't find a project to add migrations to
Actual:
You get the following error messages:
Get-Project : The current environment doesn't have a solution open.
At C:\Users\divega\Documents\Visual Studio 11\Projects\ConsoleApplication11\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:452 char:27
+ $project = Get-Project <<<<
+ CategoryInfo : InvalidOperation: (:) [Get-Project], InvalidOperationException
+ FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.GetProjectCommand
Cannot determine a valid start-up project. Using project '' instead. Your configuration file and working directory may not be set as expected. Use the -StartUpProjectName parameter to set one explicitly. Use the -Verbose switch for more information.
Exception calling "BuildProject" with "3" argument(s): "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
At C:\Users\divega\Documents\Visual Studio 11\Projects\ConsoleApplication11\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:579 char:45
+ $DTE.Solution.SolutionBuild.BuildProject <<<< ($configuration, $project.UniqueName, $true)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
Get-Project : The current environment doesn't have a solution open.
At C:\Users\divega\Documents\Visual Studio 11\Projects\ConsoleApplication11\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:452 char:27
+ $project = Get-Project <<<<
+ CategoryInfo : InvalidOperation: (:) [Get-Project], InvalidOperationException
+ FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.GetProjectCommand
Exception calling "BuildProject" with "3" argument(s): "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
At C:\Users\divega\Documents\Visual Studio 11\Projects\ConsoleApplication11\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:579 char:45
+ $DTE.Solution.SolutionBuild.BuildProject <<<< ($configuration, $project.UniqueName, $true)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
Get-Package : Cannot validate argument on parameter 'ProjectName'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.
At C:\Users\divega\Documents\Visual Studio 11\Projects\ConsoleApplication11\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:591 char:40
+ $package = Get-Package -ProjectName <<<< $project.FullName | ?{ $_.Id -eq 'EntityFramework' }
+ CategoryInfo : InvalidData: (:) [Get-Package], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,NuGet.PowerShell.Commands.GetPackageCommand
The EntityFramework package is not installed on project ''.
For an empty solution you get this:
Cannot determine a valid start-up project. Using project '' instead. Your configuration file and working directory may not be set as expected. Use the -StartUpProjectName parameter to set one explicitly. Use the -Verbose switch for more information.
Exception calling "BuildProject" with "3" argument(s): "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
At C:\Users\divega\Documents\Visual Studio 11\Projects\MvcApplication2\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:579 char:45
+ $DTE.Solution.SolutionBuild.BuildProject <<<< ($configuration, $project.UniqueName, $true)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
The project '' failed to build.
1. Create a project
2. Install EntityFramework package
3. Close solution
4. Type Enable-Migrations on Package Manager Console
Expected:
Get a simple error saying that we couldn't find a project to add migrations to
Actual:
You get the following error messages:
Get-Project : The current environment doesn't have a solution open.
At C:\Users\divega\Documents\Visual Studio 11\Projects\ConsoleApplication11\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:452 char:27
+ $project = Get-Project <<<<
+ CategoryInfo : InvalidOperation: (:) [Get-Project], InvalidOperationException
+ FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.GetProjectCommand
Cannot determine a valid start-up project. Using project '' instead. Your configuration file and working directory may not be set as expected. Use the -StartUpProjectName parameter to set one explicitly. Use the -Verbose switch for more information.
Exception calling "BuildProject" with "3" argument(s): "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
At C:\Users\divega\Documents\Visual Studio 11\Projects\ConsoleApplication11\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:579 char:45
+ $DTE.Solution.SolutionBuild.BuildProject <<<< ($configuration, $project.UniqueName, $true)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
Get-Project : The current environment doesn't have a solution open.
At C:\Users\divega\Documents\Visual Studio 11\Projects\ConsoleApplication11\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:452 char:27
+ $project = Get-Project <<<<
+ CategoryInfo : InvalidOperation: (:) [Get-Project], InvalidOperationException
+ FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.GetProjectCommand
Exception calling "BuildProject" with "3" argument(s): "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
At C:\Users\divega\Documents\Visual Studio 11\Projects\ConsoleApplication11\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:579 char:45
+ $DTE.Solution.SolutionBuild.BuildProject <<<< ($configuration, $project.UniqueName, $true)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
Get-Package : Cannot validate argument on parameter 'ProjectName'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.
At C:\Users\divega\Documents\Visual Studio 11\Projects\ConsoleApplication11\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:591 char:40
+ $package = Get-Package -ProjectName <<<< $project.FullName | ?{ $_.Id -eq 'EntityFramework' }
+ CategoryInfo : InvalidData: (:) [Get-Package], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,NuGet.PowerShell.Commands.GetPackageCommand
The EntityFramework package is not installed on project ''.
For an empty solution you get this:
Cannot determine a valid start-up project. Using project '' instead. Your configuration file and working directory may not be set as expected. Use the -StartUpProjectName parameter to set one explicitly. Use the -Verbose switch for more information.
Exception calling "BuildProject" with "3" argument(s): "The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
At C:\Users\divega\Documents\Visual Studio 11\Projects\MvcApplication2\packages\EntityFramework.5.0.0-rc\tools\EntityFramework.psm1:579 char:45
+ $DTE.Solution.SolutionBuild.BuildProject <<<< ($configuration, $project.UniqueName, $true)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ComMethodTargetInvocation
The project '' failed to build.