如何从 nuget 包中排除子目录和内容

jay*_*yco 4 .net c# nuget nuspec octopus-deploy

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

我有以下文件夹结构:

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

我试图排除“Dontwanthisfolder”

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

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

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

有人知道我怎样才能实现这一目标吗?

Mik*_*ley 6

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

<files>
    <file src="..\Web\Views\**\*.*" exclude="..\Web\Views\DontWantThis\*" target="Web\Views" />
</files>
Run Code Online (Sandbox Code Playgroud)

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

Root
   |
   Source
        |
        Test.nuspec
   Web
     |
     Scripts
           |
           Script.js
     Views
         |
         DontWantThis
                    |
                    Bad.cshml
         WantThis
                |
                Good.cshtml
         ...
Run Code Online (Sandbox Code Playgroud)