lib 文件夹外的 NuGet 程序集 [英] NuGet Assembly outside lib folder

查看:46
本文介绍了lib 文件夹外的 NuGet 程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将在这里提出几个问题...首先,使用 NuGet 是否可以从几个 DLL 创建一个包?没有 Visual Studio 项目,只有命令行和几个预编译的 DLL 文件.

I'm going to bang out a couple of questions here...first, with NuGet is it possible to create a package from a few DLLs? There is no visual studio project, just the command line and a couple of pre-compiled DLL files.

其次,假设这是可能的,为什么我会不断收到在 lib 文件夹之外的程序集"警告?我已经尝试了所有我能想到的方法来获取关联的程序集,将它们自己添加为 NuGet 包内的引用.

Second, assuming that is possible, why do I continuously get the "Assembly outside of the lib folder" warning? I've tried everything I can think of to get associated assemblies to add themselves as references inside of the NuGet package.

我的文件结构是这样的

 Root
   - File1.dll
   - lib
     - File2.dll
     - File3.dll

当我告诉 NuGet 使用这样的 .nuspec 打包时

When I tell NuGet to pack it using a .nuspec like this

<?xml version="1.0"?>
<package >
  <metadata>
    <id>File1.dll</id>
    <version>1.0.0</version>
    <authors>thisguy</authors>
    <owners>thisguysmom</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>This is some library</description>
    <releaseNotes>Porting to NuGet</releaseNotes>
    <copyright>Copyright 2012</copyright>
    <references>
      <reference file="File2.dll" />      
      <reference file="File3.dll" />
    </references>
  </metadata>
</package>

我收到了那个警告.从我正在阅读的内容来看,我什至不必在我的任何项目中定义引用节点,因为应该自动将 lib 文件夹项添加为引用?

I receive that warning. From what I'm reading, I shouldn't even have to define the references node in any of my projects, as the lib folder items should automatically be added as references?

有人了解 NuGet 的混乱吗?

Does anyone out there understand this NuGet mess?

推荐答案

您想要引用的任何 dll 都应该在 lib 文件夹下.警告是因为 file1.dll 在 lib 之外,在安装包时会被忽略.(其他特殊文件夹是内容"和工具")

Any dll that you want referenced should be under the lib folder. The warning is because file1.dll is outside lib and will be ignored during package installation. (Other special folder are "content" and "tools")

我使用过这个结构:

Root
  - lib
    - File1.dll
    - File2.dll
    - File3.dll

请参阅:http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Package_Conventions 了解更多详情.

See : http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Package_Conventions for additional details.

这篇关于lib 文件夹外的 NuGet 程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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