【问题标题】:How to exclude a subdirectory and contents from a nuget package如何从 nuget 包中排除子目录和内容
【发布时间】:2014-10-01 13:24:27
【问题描述】:

所以我有一个网站,我正在尝试为 Octopus Deploy 打包。

我有以下文件夹结构:

Web | Views | WantThis Dontwantthis WantThis1 WantThis2 ... (lots more) Scripts

我正在尝试排除“Dontwantthisfolder”

所以我的 nuspec 看起来像这样:

... <file src="..\Web\Views\**\*.*" exclude="**\Dontwantthis\**" target="web\Views" /> ...

但它不起作用,我仍然得到“Dontwantthis”文件夹。

有谁知道我是怎么做到的?

【问题讨论】:

    标签: c# .net nuget octopus-deploy nuspec


    【解决方案1】:

    你已经很接近了。试试这个:

    <files>
        <file src="..\Web\Views\**\*.*" exclude="..\Web\Views\DontWantThis\*" target="Web\Views" />
    </files>
    

    我能够使用以下文件系统结构排除DontWantThis:

    Root
       |
       Source
            |
            Test.nuspec
       Web
         |
         Scripts
               |
               Script.js
         Views
             |
             DontWantThis
                        |
                        Bad.cshml
             WantThis
                    |
                    Good.cshtml
             ...
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 2016-04-09
      • 2011-01-15
      • 2021-11-22
      • 1970-01-01
      相关资源
      最近更新 更多