如何从nuget包中排除子目录和内容 [英] How to exclude a subdirectory and contents from a nuget package

查看:108
本文介绍了如何从nuget包中排除子目录和内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我有一个网站要打包为Octopus Deploy.

So I've a website that I'm trying to package for Octopus Deploy.

我具有以下文件夹结构:

I've the following folder structure:

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

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

我正在尝试排除"Dontwantthisfolder"

I'm trying to exclude the "Dontwantthisfolder"

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

So my nuspec looks like this:

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

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

虽然它不起作用,但我仍然得到"Dontwantthis"文件夹.

It's not working though, I still get the "Dontwantthis" folder.

有人知道我怎么能做到这一点吗?

Anyone know how I can achieve this?

推荐答案

您非常接近.试试这个:

You're quite close. Try this:

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

我能够通过以下文件系统结构来排除DontWantThis:

I was able to get this to exclude DontWantThis with the following file system structure:

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

这篇关于如何从nuget包中排除子目录和内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆