简体   繁体   English

NuGet包恢复网站

[英]NuGet Package restore for website

I am trying to use NuGet Package Restore with VS2010 + Visual Sourcesafe . 我正在尝试使用VS2010 + Visual Sourcesafe进行 NuGet Package Restore。 It is working partially for me. 它部分适用于我。 Where this is coming from: NuGet not getting missing packages 来自何处: NuGet没有丢失包裹

在此输入图像描述

My Solution2 has asp.net website[Project1 in above image] that has another nuget package installed. 我的Solution2有asp.net网站[上图中的Project1],安装了另一个nuget包。 Now another developer opens the Solution2 via VS2010, the automatic restore works for Library projects in Solution1. 现在,另一位开发人员通过VS2010打开Solution2,自动恢复适用于Solution1中的库项目。 It gets all missing packages for Library projects that is referenced in this Solution2 and I see them in Solution1/packages folder. 它获取了此Solution2中引用的库项目的所有缺少的包,我在Solution1 / packages文件夹中看到它们。

But for Website it says external dlls ie pacakages missing. 但对于网站而言,它表示外部dll即缺少pacakages。 The issue I think is because website doesn't have a .csproj file and so it doesn't know things needs to be restored.( http://nuget.codeplex.com/workitem/1663 ) 我认为这个问题是因为网站没有.csproj文件,因此不知道需要恢复的东西。( http://nuget.codeplex.com/workitem/1663

Making it work partially: 使其部分工作:

  • Added packages/repositories.config to website solution ( What is a solution folder in visual studio ) 将packages / repositories.config添加到网站解决方案( visual studio中的解决方案文件夹是什么

  • Another developer goes to VSS and get that packages folder manually. 另一位开发人员前往VSS并手动获取该packages文件夹。 Now when he builds the solution, the Package Manager Console prompts for restore ie has "Restore" button. 现在,当他构建解决方案时,程序包管理器控制台会提示进行还原,即具有“还原”按钮。 On clicking it will bring the AjaxControlToolkit. 单击它将带来AjaxControlToolkit。

Questions: - Is the above approach the only and best available for Websites? 问题: - 上述方法是否仅适用于网站?

  • When the developer clicks "Restore" button it brings packages for Library as well to Solution1/packages along with packages for nuget. 当开发人员单击“恢复”按钮时,它会将Library的包以及解决方案1 ​​/包以及nuget的包。 Any reason why would it do that? 有什么理由会这样做吗?

Any ideas on above issues? 关于上述问题的任何想法?

Per you link, nuget doesn't support websites. 根据您的链接,nuget不支持网站。 If you really need to use Nuget, and let's face it, everyone does, then in my opinion the best approach is to switch your website over to a web application, at which point visual studio will create a csproj file for you, detailing the nuget packages that are contained in the project. 如果你真的需要使用Nuget,让我们面对它,每个人都这样做,那么在我看来最好的方法是将你的网站切换到一个web应用程序,此时visual studio将为你创建一个csproj文件,详细介绍nuget包含在项目中的包。 HTH HTH

For adding Solution level "packages" folder with repositories.config to VS Solution Explorer, I created a Solution folder and added repositories.config. 要将带有repositories.config的解决方案级别“packages”文件夹添加到VS Solution Explorer,我创建了一个Solution文件夹并添加了repositories.config。

That created packages folder in the SourceSafe when I checked-in the solution. 当我签入解决方案时,在SourceSafe中创建了packages文件夹。

I also found someone pointing the same thing here . 我也发现有人在这里指出同样的事情

Update: I think the newer nuget is restoring the packages. 更新:我认为新的nuget正在恢复软件包。 But one other trick for nuget to add the dll to the bin folder it to check-in the .refresh files for AjaxControlToolkit and its dependent packages. 但另一个技巧是nuget将dll添加到bin文件夹中,以检查AjaxControlToolkit及其依赖包的.refresh文件。

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

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