NuGet Package restore for website

主宰稳场 提交于 2019-12-22 09:17:46

问题


I am trying to use NuGet Package Restore with VS2010 + Visual Sourcesafe. It is working partially for me. Where this is coming from: NuGet not getting missing packages

My Solution2 has asp.net website[Project1 in above image] that has another nuget package installed. Now another developer opens the Solution2 via VS2010, the automatic restore works for Library projects in Solution1. It gets all missing packages for Library projects that is referenced in this Solution2 and I see them in Solution1/packages folder.

But for Website it says external dlls i.e. pacakages missing. 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)

Making it work partially:

  • Added packages/repositories.config to website solution (What is a solution folder in visual studio)

  • Another developer goes to VSS and get that packages folder manually. Now when he builds the solution, the Package Manager Console prompts for restore i.e. has "Restore" button. On clicking it will bring the 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. Any reason why would it do that?

Any ideas on above issues?


回答1:


Per you link, nuget doesn't support websites. 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. HTH




回答2:


For adding Solution level "packages" folder with repositories.config to VS Solution Explorer, I created a Solution folder and added repositories.config.

That created packages folder in the SourceSafe when I checked-in the solution.

I also found someone pointing the same thing here.

Update: I think the newer nuget is restoring the packages. 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.



来源:https://stackoverflow.com/questions/17864769/nuget-package-restore-for-website

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!