简体   繁体   English

Visual Studio 2015 Nuget包未还原

[英]Visual studio 2015 nuget package not restoring

I've got a project with multiple nuget projects, when I opened this project with visual studio 2015 I did a nuget restore, but all packages references are still broken. 我有一个包含多个nuget项目的项目,当我使用Visual Studio 2015打开该项目时,我进行了nuget还原,但是所有包引用仍然损坏。 In the packages folder, all the packages have been downloaded. 在packages文件夹中,所有软件包均已下载。 How can I restore the packages? 如何恢复软件包? It is important that the versions currently defined stay the same and don't upgrade the packages. 重要的是,当前定义的版本必须保持不变,并且不要升级软件包。

在此处输入图片说明

If I unload my project, the references seem good, the package versions match: 如果我卸载项目,则引用似乎很好,软件包版本匹配:

<Reference Include="Dapper">
  <HintPath>..\packages\Dapper.1.42\lib\net45\Dapper.dll</HintPath>
</Reference>
<Reference Include="EasyNetQ">
  <HintPath>..\packages\EasyNetQ.0.49.3.390\lib\net40\EasyNetQ.dll</HintPath>
</Reference>
<Reference Include="FluentScheduler">
  <HintPath>..\packages\FluentScheduler.3.1.45\lib\net40\FluentScheduler.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
  <HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>

First navigate to C:\\Users\\.dnx\\packages and delete all packages from this location. 首先,导航到C:\\ Users \\ .dnx \\ packages并从该位置删除所有软件包。

Next, in VS2015 load your project and in the Package Manager Console run dnu restore (you may have to use the cd command to get into the same directory as your project.json file if it doesn't default you to there) 接下来,在VS2015中加载您的项目,然后在Package Manager控制台中运行dnu restore (如果您的project.json文件未默认到该目录,则可能必须使用cd命令进入该目录)

The .nuget folder was missing. .nu​​get文件夹丢失。 For some sort of reason, committing my .nuget folder from the original solution to the projects SVN, and then updating the broken project SVN fixed the problem. 由于某种原因,将我的.nuget文件夹从原始解决方案提交到项目SVN,然后更新损坏的项目SVN可以解决此问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM