【问题标题】:Nuget Package is not including self as a dependencyNuget 包不包括 self 作为依赖项
【发布时间】:2017-09-24 08:51:10
【问题描述】:

我正在从类库中创建一个 nuget 包。我对工作正常的文件有明确的包含,但我的 dll 没有包含在包中。我的印象是,默认情况下,nuget 包会将自己作为 dll 包含在包中,我可能会弄错。我的 nuspec 文件如下所示:

<?xml version="1.0"?>
  <package >
    <metadata>
      <id>DTOCodeGenerator</id>
      <version>1.0.0.1</version>
      <title>DTO Code Generator</title>
      <authors>Short Circuit</authors>
      <owners>J5</owners>
      <requireLicenseAcceptance>false</requireLicenseAcceptance>
      <description>DTO Code Generator Includes the needed include tt files to generate interface backed DTO's with adapter generation</description>
      <releaseNotes></releaseNotes>
      <copyright>Copyright 2017</copyright>
      <tags>DTOGenerator T4</tags>
      <dependencies>
        <dependency id="EntireOne.Shared.T4" version="2.0.10.24" />
      </dependencies>
    </metadata>
    <files>
      <file src="T4Generators\AutoMapperExtensions.ttinclude" target="content\T4Generators\AutoMapperExtensions.ttinclude"/>
      <file src="T4Generators\ConstGenerator.ttinclude" target="content\T4Generators\ConstGenerator.ttinclude"/>
      <file src="T4Generators\DTOGenerator.ttinclude" target="content\T4Generators\DTOGenerator.ttinclude"/>
      <file src="T4Generators\EnumGenerator.ttinclude" target="content\T4Generators\EnumGenerator.ttinclude"/>
    </files>
  </package>

如何将我当前的 dll 添加到 nuget 包中

【问题讨论】:

标签: c# nuget generator t4 nuspec


【解决方案1】:

如果其他人想知道您所要做的就是在文件中添加另一行并像这样引用您的 dll:

<file src="bin\Debug\DTOCodeGenerator.dll" target="lib"/>

【讨论】:

    猜你喜欢
    • 2012-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-19
    • 1970-01-01
    • 2023-03-09
    • 2014-08-20
    • 1970-01-01
    相关资源
    最近更新 更多