首页 \ 问答 \ 如何让NuGet安装/更新packages.config中的所有软件包?(How do I get NuGet to install/update all the packages in the packages.config?)

如何让NuGet安装/更新packages.config中的所有软件包?(How do I get NuGet to install/update all the packages in the packages.config?)

我有一个解决方案,其中有多个项目。 大多数第三方引用都缺少,但每个项目都有packages.config文件。 如何让NuGet安装/更新所需的所有软件包? 这是否需要通过每个项目的命令行完成?


I have a solution with multiple projects in it. Most of the third party references are missing, yet there are packages.config file for each project. How do I get NuGet to install/update all the packages needed? Does this need to be done via command line for each project?


原文:https://stackoverflow.com/questions/6876732
更新时间:2022-03-04 18:03

最满意答案

这对我有用。

SortSpan sortSpan = SortSpan.All;                               
Type type = typeof(SortSpan);
MemberInfo[] memberInfo = type.GetMember(sortSpan.ToString());
object[] attributes = memberInfo[0].GetCustomAttributes(typeof(DisplayAttribute), false);
string name = ((DisplayAttribute)attributes[0]).Name;

我使用了此链接中的答案获取Enum值的属性

[更新]这是合并的代码。 它没有经过测试,仅使用文本编辑器进行了编辑。

 @*Top Sort Span Buttons *@
    @if(Model.Context != null && Model.Sort == TestSite.Domain.Models.SortAlgorithm.Top)
    {
        < div >
            < ul class="tabmenu submenu">
                @{
                    var spans = new SortSpan[] { SortSpan.Day, SortSpan.Week, SortSpan.Month, SortSpan.Quarter, SortSpan.Year, SortSpan.All };
                    Type type = typeof(SortSpan);
                    foreach (var span in spans)
                    {
                        MemberInfo[] memberInfo = type.GetMember(span.ToString());
                        object[] attributes = memberInfo[0].GetCustomAttributes(typeof(DisplayAttribute), false);
                        string name = ((DisplayAttribute)attributes[0]).Name;
                        <li class='@(Model.Span.HasValue && Model.Span.Value == span ? "selected" : "disabled")'>@Html.RouteLink(name, Model.Submissions.RouteName, new { sort = (Model.Sort == null ? "" : Model.Sort.ToString().ToLower()), span = name.ToLower() })</li>
                    }
                }
            </ul>
        </div>
    }

This works for me.

SortSpan sortSpan = SortSpan.All;                               
Type type = typeof(SortSpan);
MemberInfo[] memberInfo = type.GetMember(sortSpan.ToString());
object[] attributes = memberInfo[0].GetCustomAttributes(typeof(DisplayAttribute), false);
string name = ((DisplayAttribute)attributes[0]).Name;

I used an answer from this link Getting attributes of Enum's value

[Update] Here is the merged code. It's not tested, just edited with an text editor.

 @*Top Sort Span Buttons *@
    @if(Model.Context != null && Model.Sort == TestSite.Domain.Models.SortAlgorithm.Top)
    {
        < div >
            < ul class="tabmenu submenu">
                @{
                    var spans = new SortSpan[] { SortSpan.Day, SortSpan.Week, SortSpan.Month, SortSpan.Quarter, SortSpan.Year, SortSpan.All };
                    Type type = typeof(SortSpan);
                    foreach (var span in spans)
                    {
                        MemberInfo[] memberInfo = type.GetMember(span.ToString());
                        object[] attributes = memberInfo[0].GetCustomAttributes(typeof(DisplayAttribute), false);
                        string name = ((DisplayAttribute)attributes[0]).Name;
                        <li class='@(Model.Span.HasValue && Model.Span.Value == span ? "selected" : "disabled")'>@Html.RouteLink(name, Model.Submissions.RouteName, new { sort = (Model.Sort == null ? "" : Model.Sort.ToString().ToLower()), span = name.ToLower() })</li>
                    }
                }
            </ul>
        </div>
    }

相关问答

更多
  • 使用.map()方法! import React from 'react'; class NewComponent extends React.Component { render() { let arrr = ['foodA', 'foodB', 'FoodC']; let answer = arrr.map((food, index) => { return React.createElement( 'li', { key: index }, ...
  • 将id提供给ul标签并将其样式显示为:none。 然后,在你的CSS #id ul li:hover> ul { display:block } Give id to ul tag and give its style display:none. then, in your css #id ul li:hover > ul { display:block }
  • 这对我有用。 SortSpan sortSpan = SortSpan.All; Type type = typeof(SortSpan); MemberInfo[] memberInfo = type.GetMember(sortSpan.ToString()); object[] attributes = memberInfo[0].GetCustomAttributes(typeof(DisplayAttribute), false); s ...
  • 当页面加载时,您可以使用.parents()或:has()显示活动的父.parents() : $(function() { $('.active').parents().show();​​​​​​​​​ //or.. $(':has(.active)').show();​​​​​​​​​ }); 这些中的任何一个都可以处理任何数量级别,但第一个会更快一些。 You can show the active's parents using .parents() or :has() when th ...
  • 使用Html方法而不是文本方法。 文本将HTML编码传递给它的所有内容。 var li = $('
  • ') .addClass('moveTF') .attr('data-questionid', tfData[i].id) .attr('data-selected', tfData[i].selected) .html(question); Use the Html method rather than the text method. Text ...
  • 您可以尝试使用:: after伪类强制装箱。 即 #questions li::after { display:table-cell; content: '' } http://jsfiddle.net/t6exT/11/ You could try to force the boxing with a ::after pseudo-class. i.e. #questions li::after { display:table-cell; content: '' } h ...
  • 尝试在你的CSS中添加这些行。 li.nav{display:inline-block;position:absolute;} li.nav:nth-child(2) {margin-left:140px;} 要么 HTML
  • IE8不支持CSS3的 CSS1和CSS2伪元素的双冒号表示法 。 只有IE9及更高版本以及其他浏览器才支持该表示法。 如果您需要IE8支持,则必须使用单冒号: .NewsArchive li:before, .NewsSubMenu li:before { content: "• "; display: none !important; } 不需要JavaScript。 而且你很可能不需要那么!important IE8 does not support CSS3's double-co ...
  • 我们可以用角度2的动画来实现 检查预览https://plnkr.co/edit/fNZLspjrendI5SdK5gBC?p=preview app.component.ts @Component({ selector: 'my-app', animations: [ trigger('displayName', [ state('in', style({ opacity: 1, transform: 'translateY(0)' })), state('out' ...
  • 你可以在li a子元素中使用伪元素::after 请注意,您只能将li作为ul直接子项。 否则它是无效的HTML 我调整了CSS删除重复的属性。 ul { list-style: none; margin-top: 30px } ul li a { background-color: #002163; color: white; padding: 10px; text-decoration: none; width: 200px; display: blo ...
  • 相关文章

    更多
  • Install Storm on CentOS
  • I18N 国际化 简介
  • 【转载】开源且免费软件包分类列表
  • solr config 部分注解
  • ubuntu12.10安装 jdk-7u10-linux-i586.gz
  • Hadoop的I/O
  • Bentley.STAAD.RCDC.V8i.04.01.01.03 1CD
  • Hadoop I/O系统介绍
  • Lua 文件 I/O 操作
  • Groovy 文件I/O 操作详解
  • 最新问答

    更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)