- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在尝试使用 .nuspec 文件生成 nuget 包。我们在一个屋檐下有几个项目,并试图创建 nLog.config(和转换文件)并通过 nuget 包分发它。对于任何版本的 .Net Framework,我都在寻找相同的配置文件集(只有配置没有 dll)。所以我真的不需要\lib\net45\myproject.dll 或\lib\net40\myproject.dll。虽然当我生成 nuget 包时,它总是创建 lib 文件夹并包含 dll。为与 .net Framework 版本相关的任何项目创建哪种依赖关系。
下面是我的 nuspec 文件,以防有人想引用我做错了什么。我尝试了 ""和其他一些东西,但没有运气。
<?xml version="1.0"?>
<package >
<metadata>
<id>NLogConfig</id>
<version>1.0.3</version>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>Copyright 2013</copyright>
<dependencies>
<dependency id="NLog" version="2.1.0" />
<dependency id="NLog.Schema" version="2.1.0" />
</dependencies>
</metadata>
<files>
<file src="NLog.config" target="content" />
<file src="NLog.Debug.config" target="content" />
<file src="NLog.UAT.config" target="content" />
<file src="NLog.Release.config" target="content" />
<file src="tools\*.*" target="tools"/>
</files>
</package>
如何使用 nuspec 文件(首选)或其他机制完全排除 lib 文件夹?谢谢!!
更新 1:
我试图偷偷摸摸,但没有成功。我放置了构建后事件并试图删除 DLL。但不知何故系统很聪明,它给了我错误“错误 79 无法找到‘C:\GITRepo\NLogConfig\NLogConfig\bin\Release\NLogConfig.dll’。确保项目已经构建。”
更新 2
我没有找到使用 .csproj 构建 nuget 包的方法,但使用外部命令并指定 nuspec 文件我能够获得相同的结果。问题仍然存在,这只是我的解决方法。
最佳答案
我想分享我的经验。我需要的是使用 csproj 作为 Nuget.exe 目标(因为我希望 NuGet 自动解析依赖项)并且结果包中没有 lib 文件夹。为了省略该文件夹,我使用了以下命令:
nuget pack <projectPath> -Exclude bin/**/*.*
关于c# - Nuget包生成排除lib文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20336807/
我已经在Visual Studio中创建了新的解决方案,启用了nuget包还原,并进入了解决方案根.nuget文件夹,该文件夹包含使包还原正常工作所需的以下文件:NuGet.exe,NuGet.con
自 Nuget 1.5 以来,我的团队一直在使用“启用包还原”选项,以使包不受我们的源代码控制。当 Nuget 1.6 发布时,我们注意到一个问题,即它没有拉取软件包,并跟踪它到 .nuget 文件夹
我维护了一些小的 Nuget 包。 我在 git 存储库中有一个 Nuget README 文件,.nupkg 文件由 VS 根据“Package”配置自动构建,存储在 .csproj 文件。 每当我
我们是一个小型开发团队,我们希望开始使用我们的库作为 NuGet 包。现在我已经看到我们可以创建 NuGet 提要或 NuGet 服务器或 NuGet 画廊。 现在我们不确定有什么区别,对于我们的小团
我正在编写一个脚本,它将自动打包 Nuget 文件并将其发布到我的私有(private)存储库(文件共享)和私有(private)符号服务器(在 localhost 上)。 当我运行 nuget pa
我有一个解决方案,我想从两个项目中创建一个 NuGet 包。 如果它只是一个项目,我会使用 .csproj 文件来规范 NuGet 打包器,但由于我希望两个不同的项目进入完成的包,我不能这样做。 我创
我正在做一个需要处理 Excel 文件的项目。我为这项工作找到了一个名为 Aspose.cells 的库。它不是一个免费的图书馆,我们应该从它的网站购买它的许可证,以便在我们的项目中使用它。但是,我发
我已经使用 Nuget 安装程序创建了一个 TeamCity 构建步骤,但是当我运行这些步骤时出现错误: Updating sources: server side checkout [15:35:4
是否有任何指南或建议来管理不在 nuget 上的库以及在 nuget 上的包。 其中大多数可能是 3rd 方库,除非我们专门安装它们,否则它们可能永远不会继续使用 nuget。 最好将这些 dll 放
我一直在研究自托管 NuGet,但很难理解如何设置它以及它如何帮助支持我们的开发过程。 有没有人对使用哪个,如何设置有任何建议? 或者我应该只使用托管服务? 最佳答案 在查看了各种解决方案(自托管和托
我正在为 OSGeo.FDO 创建 nuget 包,但我遇到了以下问题。 FDO 使用 providers.xml列出它可以使用的所有提供程序的文件。所以我创建了一个名为 OSGeo.FDO 的主包包
我想知道 NuGet 的含义是什么。它是像blah blah get这样的东西吗?它甚至有一个有意义的名字吗?或者它是某物的缩写还是有人为了好玩而决定这个名字?请帮忙,这个问题已经困扰了我 1 周。
This question already has answers here: Is it possible to change the location of packages for NuGet?
如何在 Visual Studio 之外下载 NuGet 包?所以它可以用来创建离线包。 最佳答案 如何在没有 Visual Studio 或 Nuget 包管理器的情况下下载 NuGet 包: 在
我似乎在网络上找不到任何对此表示赞同或反对的地方。谁能指出我的答案吗?或者更好的是,如果您从事 NuGet 工作,您能否给出一些指示,说明是否有任何计划允许商业库包(我认为需要某种身份验证)包含在未来
我已经打开了 TeamCity 的 NuGet 服务器,我想推送公共(public)包(即来自 NuGet.org 等公共(public)资源),因为构建服务器无法看到我们公司外部的信息,因此从 Nu
在我的工作团队中,我们依赖两个 NuGet 提要:来自 NuGet.org 的官方提要用于公共(public)包,而我们文件服务器上的文件夹用于内部包。 这对我们来说效果很好,但我认为我们有一个潜在的
我在我工作的 Web 服务器(在 IIS 7.0 下)上设置了新的 NuGet Gallery。该网站本身已设置并运行良好。我们能够注册帐户、确认电子邮件地址,甚至通过网站本身上传新包。 我们的自动构
当我们在 Visual Studio 2017 中创建 nuget 包时,它默认将项目引用添加为另一个 nuget 引用。 我们如何在创建包时禁用它,而是: 选择不同的包名 在创建包时包含项目的 dl
我可以执行类似 - mono --runtime=v4.0.30319 /Library/TeamCity/buildAgent/work/b0d2d3fefe88d393/.nuget/NuGet.
我是一名优秀的程序员,十分优秀!