[英]Reinstall NuGet packages for ASP.NET Website outside Visual Studio
I have ASP.NET website which does not have .csproj file (it's not web application), only .sln file. 我有ASP.NET网站没有.csproj文件(它不是Web应用程序),只有.sln文件。 In root is packages.config having several NuGet packages defined.
在root中是packages.config,它定义了几个NuGet包。
Calling nuget restore .\\packages.config -PackagesDirectory .\\packages
downloads packages to packages
folder, but bin
folder is empty. 调用
nuget restore .\\packages.config -PackagesDirectory .\\packages
将包下载到packages
文件夹,但bin
文件夹为空。
nuget update
requires .csproj. nuget update
需要.csproj。
If I call build of website in a command line it will throw an error that DLLs were not found. 如果我在命令行中调用build的构建,则会抛出找不到DLL的错误。 If I keep
bin\\*.refresh
it does not work either. 如果我保留
bin\\*.refresh
它也不起作用。
Thank you 谢谢
You need to have a .refresh
file for each of the packages you expect to be copied to the bin
directory. 您需要为要复制到
bin
目录的每个包都有一个.refresh
文件。
For example, we have a custom build of MvcSiteMapProvider.MVC2
in one of our web sites. 例如,我们在其中一个网站上有一个
MvcSiteMapProvider.MVC2
的自定义版本。
<package id="Mvc2" version="2.0.1" targetFramework="net35" />
<package id="MvcSiteMapProvider.MVC2.Core" version="4.6.18.1" targetFramework="net35" />
System.Web.Mvc.dll.refresh
MvcSiteMapProvider.dll.refresh
NOTE: It may be tricky to get your source control provider to recognize these.
注意:让源控制提供程序识别这些可能会很棘手。 Make sure they are there when you clone your project to a clean directory.
将项目克隆到干净的目录时,请确保它们在那里。
..\..\packages\Mvc2.2.0.1\lib\net35\System.Web.Mvc.dll
..\..\packages\MvcSiteMapProvider.MVC2.Core.4.6.18.1\lib\net35\MvcSiteMapProvider.dll
You may need to adjust the number of ..\\
in your project depending on the folder structure, but this is what we have that restores successfully. 您可能需要根据文件夹结构调整项目中的
..\\
的数量,但这是我们成功恢复的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.