【发布时间】:2015-09-14 06:28:14
【问题描述】:
由于我的 Surface pro 3 中的一些网卡问题,我将我的 Windows 10 安装刷新到了几天前(大约一周)PC 的状态。据说这个选项只会更改设置和安装(注册密钥、安装的软件等)
之后,我无法让 Nuget 在 Visual Studio 上正常工作。以下是症状:如果在依赖解析和添加文件之后添加一个包,例如 MVVMLight,这就是我在控制台中看到的:
Executing script file 'C:\Users\Erick\Documents\Projects\test\packages\MvvmLight.5.2.0.0\tools\install.ps1'...
null : The term 'null' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\Users\Erick\Documents\Projects\test\packages\MvvmLight.5.2.0.0\tools\install.ps1:160 char:15
+ $resources = null
+ ~~~~
+ CategoryInfo : ObjectNotFound: (null:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Locator
#text
-----
True
Successfully installed 'MvvmLight 5.2.0' to Cierre de Eventos
========== Finished ==========
项目中的 packages.config 文件已正确更新:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CommonServiceLocator" version="1.3" targetFramework="net46" />
<package id="MvvmLight" version="5.2.0.0" targetFramework="net46" />
<package id="MvvmLightLibs" version="5.2.0.0" targetFramework="net46" />
</packages>
然后创建包文件夹并在其中包含这些包。问题是在每个包文件夹中,例如 MvvmLight.5.2.0.0,我只看到:
Content (Folder)
tools (Folder)
MvvmLight.5.2.0.0.nupkg
MvvmLight.5.2.0.nupkg
没有 lib 文件夹,当然也没有 MvvmLight.5.2.0.0.dll!由于没有提取任何 dll,因此不会将其添加到项目的引用中...
此外,在根目录中,也没有 .nuget 文件夹...我知道在我较旧的 VS 项目中,有一个 .nuget 文件夹,但我不确定 Nuget 是否是这样工作的(如在 VS2015/Nuget 的最新版本中)。
使用像 FirebirdSql.Data.FirebirdClient.4.7.0.0 这样的包,我在控制台中没有收到任何与“null”相关的错误,创建了 lib 文件夹,但在 net45 文件夹中只有一个调试文件FirebirdSql.Data.FirebirdClient.pdb,没有dll...
所以我已经卸载/重新安装了 nuget,卸载/重新安装了 Visual Studio,但仍然是同样的问题......我该怎么做才能解决这个问题?
【问题讨论】:
-
Powershell 坏了,是解释那个脚本的程序。无法想象为什么它不能解析 $resource = null。 Google 知道另外两个人有这个问题,当然没有答案。
标签: visual-studio nuget visual-studio-2015