我正在尝试遵循此post 通过命令行将nuget包添加到我的解决方案中。
但是,当我尝试运行以下命令时:
Install-package nuget -solution mysolution.sln -projectName myproject
我收到以下错误,
Can't read Microsoft Solution file format 12.00
Install-Package : A project must be open to run this command.
At line:1 char:16
+ install-package <<<< nuget -solution mysolution.sln -projectname
myproject
+ CategoryInfo : InvalidOperation: (:) [Install-Package], Invalid OperationException
+ FullyQualifiedErrorId : NoProjectOpen,ICSharpCode.PackageManagement.Cmdlets.InstallPackageCmdlet
根据此post,我尝试设置项目名称
set-project myproject mysolution.sln
我收到此错误,
Can't read Microsoft Solution file format 12.00
Set-Project : Unknown project: myproject
At line:1 char:12
+ set-project <<<< myproject mysolution.sln
+ CategoryInfo : NotSpecified: (:) [Set-Project], ApplicationException
+ FullyQualifiedErrorId : System.ApplicationException,ICSharpCode.PackageManagement.Cmdlets.SetProjectCmdlet
我检查了sln文件,它有我想要添加的确切项目名称。什么可能是问题的任何猜测?或者,有没有办法通过一些命令找到我的解决方案的项目名称,以便我可以交叉检查?